Thursday, May 24, 2012

X++ code to validate only numbers in string


static void TextBuffer_regularExpression(Args _args)
{

    TextBuffer txt = new TextBuffer();
    str msg = "98797897";
    ;


    txt.setText(msg);
    txt.regularExpressions(true);   // activate regular expr in search


     // Regular expression to validate only digits 
     if (txt.find("^[0-9]+$"))
    {
        info("string contains only numbers");
    }

}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...