Do not try to put more characters into string that its size

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BLOMASKY
Posts: 1490
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Do not try to put more characters into string that its size

Post by BLOMASKY »

So, not being very smart, I have a text field in regular user that was the length of 12. I then, in a process tried to put more than 12 characters into it. It does not cause an error to be displayed, but it really messes up the system, with connection errors, refresh not working, etc. etc.

Just a word to the wise.

Bruce
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: Do not try to put more characters into string that its s

Post by BenHayat »

That happened to me once accidentally (I was supposed to create a 40 char, but created 4), but the only thing Aware did, was to truncate it to 4 char.
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Do not try to put more characters into string that its s

Post by Jaymer »

If you examine import logs, using CSV, it will complain a lot if fields are longer than defined in the db. which will slow down your imports if you do a lot of it, i would guess.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Powerm
Posts: 476
Joined: Mon Feb 01, 2010 9:44 pm

Re: Do not try to put more characters into string that its s

Post by Powerm »

Happened to me where the app works working perfectly on my testing machine with dummy datas ( John SMITH ) and acts strangely once published and going live with client's existing datas like "John ( the friend of Paul who recommended him las year, a friend of Harry...) .

As you said, no error is displayed but the client thinks your app does not work :(
Independent Developer
BLOMASKY
Posts: 1490
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: Do not try to put more characters into string that its s

Post by BLOMASKY »

Jaymer, this was NOT import. This was a business rule, i.e. if BO.qtyOnHand = 0 then BO.msg = 'No Stock to Sell'

Only way to find the error then, is to look at the Tomcat log and see where it chokes.

bruce
Powerm
Posts: 476
Joined: Mon Feb 01, 2010 9:44 pm

Re: Do not try to put more characters into string that its s

Post by Powerm »

It my case it was not the import but the calculated fields ( I import Customer.FirstName and Customer.LastName and have a calculated field which is Customer FullName=Customer.FirstName+' '+Customer.LastName ).

That's why we should extra space to some attributes, it betters to put 200 as max length to the FirstName attribute instead of 40. Same for email attribute length, I always use 200 as max lengh.
Independent Developer
Markfre1
Posts: 221
Joined: Sun Mar 11, 2012 10:15 pm
Location: United States

Re: Do not try to put more characters into string that its s

Post by Markfre1 »

I discovered this issue on mobile due to the following problem. If the last field that you type in mobile is a numeric field and you do not leave the field, and click OK/Save, it will not save the numeric data. You must leave the field, or come back in and edit it. After experimenting, I made the field a text field, entered data, did not leave field, did OK and it updated correctly. So I thought I'll just make it a text field and use a mask to limit it to 5 characters. Most mask do not work in mobile. So I removed the mask and typed in more characters than the field normally allows, and it kicks out with an AIM message. So the only solution, until support addresses the issue of Mask where you can limit the size, is to make the field pretty large where the user will not type more characters than expected. In a numeric, if I make it 20 or so, probably safe, but since you cannot limit the size and its text, when I had it 5, and the user type in 5 dozen, it kicked out with an error. So I don't like code where a user input can cause a problem, but i see that as the only solution, unless you somehow ensure the user leaves the numeric field before clicking OK.

Mark F.
Post Reply