Thursday, December 29, 2016

X++ code to validate Mobile no. in Ax 2012

static void MobilennoValidation(Args _args)
{

    boolean ret;
    #define.alphabets('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
    #define.numbers('0123456789')
    int len;
    str  subst,keepnum;
    str Mobile;
    Mobile = "9876543210";
    len = strLen(Mobile);
    subst= substr(Mobile,1,len);
    keepnum=strkeep(substr(Mobile , 1, len), #numbers);

    if(len!=10)
    {
         checkFailed("@DMS1713");
    }

    else if((Mobile)&&(keepnum!=subst))
    {
         checkFailed("@DMS1678");
    }
    else
    {
        info("Mobile no, is validated successfully");
    }
}


No comments:

Post a Comment

Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...