Announcements
No record found.
Is there any functions to calculate integer length / or empty
Can you elaborate more?
I need to check a integer field length and also if empty
Hi, I believe you are looking for function like StrLen() for checking length of String. There isn't any function to check it for Integer. An empty integer value is zero.
To check number of digits in integer field you can use this '
strlen(int2str(IntegerField));
Please check this thread
community.dynamics.com/.../is-it-possible-to-limit-an-integer-edt-to-a-certain-number-of-digits
www.dynamicsuser.net/.../54003
I need to check if an integer field is empty
"Empty" would be 0 as mentioned by Mohit.
There are no nullable integers in X++. An empty integer is the integer with the default value, which is zero.
The length can also be checked with normal mathematical operators, instead of doing a conversion to string. For example, (positive) integers with less than two characters are smaller than 100.
If the number can be negative, consider if you want to calculate the sign in the length. If not, you can use the absolute value. instead of the actual field value.
I have a form on which when i click a button , it opens 1st dialog . the first dialogs has 2 fields when i click ok on 1st dialog it opens 2nd dialog . i need validation at 1st dialog that if fields are empty is shouldn't open second dialog. How can i achieve it ?
You can add your validation on the CanClose method on the 1st dialog form.
canClose returns boolean value.
public boolean canClose()] { boolean ret; ret = super(); //add your logic for integer validation if(int == 0) { ret= checkfailed("Warning"); } return ret; }
Thanks,
Girish S.
If you need validation on click of OK button in dialog then you can add your validation in if (dialog.closedOk()) loop.
https://wp.me/p6FQUH-30
I Wrote 2 validations on canclose method but its not working. initially i was trying to close the form from 2nd dialog and i changed it . i am closing after clicking the button but its not working.
thanks
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 797
André Arnaud de Cal... 589 Super User 2026 Season 1
Subra 534