Validate email addresses using regular expression

Purpose: The purpose of this post is to demonstrate how can we validate the data entry of email addresses. Product: Dynamics 365 for Finance and Operations Description: The code below uses regular expressions to validate the data entry of email addresses by hooking up a ValidatedField event handler to LogisticsElectronicAddress table. Code: /// <summary> ///... Continue Reading →

Extensions examples

Purpose: The purpose of this post is to share examples of extensions. Product: Dynamics 365 for Finance and Operations Code: Form data source event handler. Event type: ValidatedWrite /// <summary> /// OnValidatedWrite handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> [FormDataSourceEventHandler(formDataSourceStr(DirPartyQuickCreateForm, DirPartyTable), FormDataSourceEventType::ValidatedWrite)] public static void DirPartyTable_OnValidatedWrite(FormDataSource sender, FormDataSourceEventArgs e) { #define.CallerFormName("CustTable") FormRun formRun... Continue Reading →

Chain of command example

Purpose: The purpose of this post is to demonstrate how we can we extend a standard code by using the chain-of-command framework. Product: Dynamics 365 for Finance and Operations Description: The code below extends the saveAttributeValueSet method of DimensionEntryControl class using the chain-of-command framework. Code: [ExtensionOf(classStr(DimensionEntryControl))] final class DimensionEntryControlSXS_Extension { public DimensionDefault saveAttributeValueSet() { #define.CallerFormName("CustTable")... Continue Reading →

Validate individual financial dimensions

Purpose: The purpose of this post is to demonstrate how we can validate individual financial dimension values before writing a customer record. Product: Dynamics 365 for Finance and Operations Description: The code below validates some customer fields like Site, Warehouse, Price group and then checks the values for individual financial dimensions in this case which... Continue Reading →

Read CSV file in X++

Purpose: The purpose of this blog post is to demonstrate how to read a csv file in X++ Product: Dynamics AX 2012 Code: static void MAKReadFile(Args _args) { #File IO io; CustAccount custAccount; Email email; FilenameOpen filename = @"C:\Temp\CustomerContactInfo.csv"; Container record; ; io = new CommaTextIo(filename, #IO_Read); if (!io || io.status() != IO_Status::Ok) { throw... Continue Reading →

Create contact information in X++

Purpose: The purpose of this blog post is to demonstrate how to create contact information in X++ Product: Dynamics AX 2012 Description: The code create contact information with purpose "Collection" on the customer record. Code: static void MAKCustContactCreate(Args _args) { #define.LocationRoleName('Collection') CustTable custTable; DirPartyTable dirPartyTable; LogisticsElectronicAddress logisticsElectronicAddress; LogisticsLocationRole locationRole; Map locationRoleMap; container locationRoleCon; ; custTable... Continue Reading →

Create print management settings in X++

Purpose: The purpose of this blog post is to demonstrate how can we create print management settings in X++ Product: Dynamics AX 2012 Description: The code creates a print management settings record on a customer for collection letter note document and uses first contact of type email and purpose "Collection" found on the customer record... Continue Reading →

Blog at WordPress.com.

Up ↑