Skip to Content
0

Validation on extension field for numeric input -Regular expression

Aug 23, 2017 at 08:31 PM

258

avatar image
Former Member

Dear Experts,

We have the requirement where we need to check if input in a extension field of type LANGUAGEINDEPENDENT_EXTENDED_Text contains characters other than the numbers. These other characters can be special characters, digits Etc.

If yes then it should not let the screen to save. For this I know we will have to use regular expression. But I don't know how to do the same and design the regular expression of such kind. Please help!

Regards,

Pragati Verma

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Marlos Augustus Maciel Damasceno Feb 05 at 06:14 PM
0

Hi Pragati,

You may use the Validation: OnSave event of your object to do this validation. There you can use this code:

if(this.yourField.FindRegex("[^[:digit:]]") >= 0) {
     raise Message.Create("E", "You should use only numbers!");
     return false;
}

If your field was created by screen you may get it using the References to Customer-Specific Fields.


Best regards

Marlos Damasceno


reference.png (47.7 kB)
Share
10 |10000 characters needed characters left characters exceeded
Srikanth Rathod Feb 05 at 07:43 AM
0

Hi Pragati,

Did you complete your requirement ?

As i have the same requirement and need you help on how did you achieve this.

Regards,
Srikanth Rathod

Share
10 |10000 characters needed characters left characters exceeded