Posts

Showing posts with the label AX Job

Fetch the customer details using X++ in AX 2012

Image
Hi Technical, Today, in this post we are going to share a X++ code to fetch the customer details as customer number, customer name, primary address, country, sales channel, sales rep., region, territories, agent, sales manager in AX 2012. When you run this X++ code in AX 2012, an excel will generate with all the data. Output: To fetch this data create an AX job in AOT and copy paste the below code. // Project Name: PKA_Adhoc_CustomerDetaills // Created By: Chirag Gupta // Created Date: 29-Jan-2020 // Summary: Fetch the customer details as customer number, customer name, primary address, // country, sales channel, sales rep., region, territories, agent, sales manager. static void PKA_GetCustomerData(Args _args) {     CustTable                                   custTable;     smmBusRelChainGroup               ...

Send email in AX 2012 using X++

Image
Hi Readers, Today, in this post we are going to share a X++ code to send email in AX 2012 using X++. // Create By: Chirag Gupta // Created Date: 2-Apr-2020 // Summary: This job will be used to send an email using AX 2012. static void PKA_TestEmail(Args _args) {     // Set these variables.     str                                   sender = 'axsupport@domain_name.com';     str                                   recipient = 'test_emailTo@domain_name.com';     str                                   cc = 'test_emailCC@domain_name.com';     str                                ...

Fetch vendor address using X++ in AX 2012

Image
Hi Technical, Today, in this post we are going to share a piece of code by which you can fetch vendor address using X++ in AX 2012. Create a AOT job and copy paste the below code to export vendor address in excel. // Project Name: PKA_WO67963_FetchCustomerVendorAddress // Created by: Chirag Gupta (ibm.chirag) // Created date: 18-Dec-19 // Summary: Fetch Vendor ID, Name or description, Address, Purpose, Primary static void PKA_VendorAddress(Args _args) {     SysExcelApplication         xlsApplication;     SysExcelWorkBooks           xlsWorkBookCollection;     SysExcelWorkBook            xlsWorkBook;     SysExcelWorkSheets          xlsWorkSheetCollection;     SysExcelWorkSheet           xlsWorkSheet;     SysExcelRange              ...

Fetch customer address using X++ in AX 2012

Image
Hi Technical, Today, in this post we are going to share a piece of code by which you can fetch customer address using X++ in AX 2012. Create a AOT job and copy paste the below code to export customer address in excel. // Project Name: PKA_WO67963_FetchCustomerVendorAddress // Created by: Chirag Gupta (ibm.chirag) // Created date: 18-Dec-19 // Summary: Fetch Customer ID, Name or description, Address, Purpose, Primary static void PKA_CustomerAddress(Args _args) {     SysExcelApplication         xlsApplication;     SysExcelWorkBooks           xlsWorkBookCollection;     SysExcelWorkBook            xlsWorkBook;     SysExcelWorkSheets          xlsWorkSheetCollection;     SysExcelWorkSheet           xlsWorkSheet;     SysExcelRange           ...

Product attributes value by item id using X++

Image
Hi Technical, Today, in this post we are going to share a piece of code to fetch product attributes value by item id using X++ in AX 2012 R2/R3. Create a AOT job and copy paste the below code: // Created By: Chirag Gupta // Created Date: 28-Jan-20 // Summary: Get product attributes values by item id. static void PKA_GetProductAttributes(Args _args) {     InventTable                     inventTable;     EcoResProductAttributeValue     ecoResProductAttributeValue;     EcoResAttribute                 ecoResAttribute;     EcoResValue                     ecoResValue;     while select inventTable where inventTable.ItemId == "FGBRDASS0001"         join RecId from ecoResProductAttributeValue             ...

AX 2012: How to enable or disable execute business operation in CIL using X++

Image
Hi Readers, Today, in this post we are going to tell you a very important topic about execute business operation in CIL, you can enable or disable execute business operation in CIL using X++. Copy the below code and paste it in AX job using AOT. // Created By: Chirag Gupta // Created Date: 27-Dec-2019 // Summary: This job code will be used for enable/disable 'Execute business operation in CIL' checkbox. static void PKA_SetCILExecution(Args _args) {     #LOCALMACRO.FLAG_ExecBusinessOpsWithInterpreter (1 << 10) #ENDMACRO     UserInfo            userInfo;     // setEnable = false; To disable Execute business operation in CIL     // setEnable = true; To enable Execute business operation in CIL     boolean             setEnabled = false;     ttsBegin;     while select forUpdate DebugInfo from user...

AX 2012 - How to delete user ids from AX using X++ code

Hi Folks, Today, in this post we will share how you can delete unwanted user ids from AX 2012 using X++ code. Code is following: Create a job in AX 2012 and copy paste below code to delete user ids from AX using X++. // Project Name: ABC_Adhoc_DeleteUserIDs // Created by: Chirag Gupta // Created date: 11-Sep-19 // Summary: This job will be used to delete user ids from AX 2012 using X++ code. static void ABC_DeleteUserIDs(Args _args) {     UserInfo        userInfo;     while select id from userInfo         where userInfo.id  == 'ahmad.el'             || userInfo.id == 'ayandak'             || userInfo.id == 'cassim.a'             || userInfo.id == 'claudine'             || userInfo.id == 'elgin.ol'             || userInfo.id == ...