Popular Posts
- Introduction & String Functions in AX 2012
- Convert Functions in ax 2012
- X++ code for Import data from excel using all datatypes in ax 2012
- (no title)
- X++ Code to create Lookup for DialogField in ax 2012 r3
- Date functions in ax 2012
- X++ code to Export data to Excel sheet in ax 2012
- AX Versions and Overview of Microsoft Dynamics AX build numbers
- X++ Code for Creating New Customer and also update Address of the customer
- X++ code for Modify dialog fields in ax 2012
Thursday, December 29, 2016
X++ code to validate Name using Regular Expression in AX 2012
public bool validateName(str _name)
{
System.Text.RegularExpressions.Match regExMatch;
bool isValid;
// other characters used in the regular expression are part of regex syntax.
regExMatch = System.Text.RegularExpressions.Regex::Match(_name, @’^[^<>:"/\\|?*]*$’);
// return true if name matches the criteria otherwise return false
isValid = regExMatch.get_Success();
return isValid;
}
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");
}
}
X++ code to cancel Sales order and Purchase orders in AX 2012
X++ Code to cancel Sales order
static void
DMSSOCancel(Args _args)
{
SalesTable salestable;
SalesUpdateRemain SalesUpdateRemain;
changeCompany('f898')
{
salestable = salestable::find("F898-000460");
SalesUpdateRemain::cancelRemainderOnOpenSalesLines(salestable);
}
}
X++ Code to cancel Purchase order
static void
DMSCancelPO(Args _args)
{
PurchFormLetter Purch;
PurchTable PurchTable;
PurchCancel PurchCancel ;
changeCompany("f898")
{
PurchTable =PurchTable::find("F898-000079");
PurchCancel = PurchCancel::construct();
PurchCancel .parmPurchTable(PurchTable);
PurchCancel .run();
}
}
Subscribe to:
Posts (Atom)
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 ...
![](https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/database/media/dbmovement_menu.png)
-
Dynamics AX Tutorial - X++ Containers Functionality March 08, 2015 http://www.daxerptraining.com/blog/dynamics-ax-tutorial-containers-fun...
-
Hi Daxer's !!! I'm very glad to explore my knowledge on Microsoft Dynamics Ax . -- " Gaining knowledge is the first s...
-
X++ Code to cancel Sales order static void DMSSOCancel(Args _args) { SalesTable salestable; ...