Skip to main content

Posts

Code to Convert Inventory to sales unit value for Item in Axapta

This is a sample Code to Convert Inventory to sales unit value for Item in Axapta . You can try this code in job to check the value. Item code you can use from your system data. I hope you will get idea and enjoy daxing. InventTableModule InventTableModule; int64 InvUnit, SalesUnit, EcoresproductRecid; UnitOfMeasureConversion UnitOfMeasureConversion; real d; select InventTableModule where InventTableModule.ItemId == '60068C' && InventTableModule.ModuleType == ModuleInventPurchSales::Invent; InvUnit = UnitOfMeasure::findBySymbol(InventTableModule.UnitId).RecId; SalesUnit = UnitOfMeasure::findBySymbol('BOX4').RecId; EcoresproductRecid = EcoResProduct::findByDisplayProductNumber('60068C').RecId; d = UnitOfMeasureConverter::convert(8.0,InvUnit,SalesUnit,NoYes::No,Ecoresproductrecid); info(strFmt("%1",d));

How to Set default value in Ax form Lookup

Problem :I need string-edit lookup display by default the code '00002' and not the '00001.How can i do this using axapta code? Solution  : Instead of asking 00002 as default in the lookup, you can set '00002' as the default value of the field on the form. Otherwise, if you don't like to have '00001' in the lookup then you need to write dynamic lookup on that field.

ERP Comparison : AX 2012 Vs. Oracle Vs. SAP

Microsoft Dynamics 365 Finance and operations

Upgrade yourself to Dynamics 365 Jupiter Dynamics

Upgrade yourself to Dynamics 365...!! Learn the most demanded ERP course by real time with hands on experienced consultants...!!

Sample Code example to create Free Text Invoice in Ax 2012

This is a sample Example of Code to create Free Text Invoice in Ax 2012. Variables you need to declare to complete code. ttsBegin; select custTable where custTable.AccountNum == '123'; custInvoiceTable.clear(); if (custTable.RecId != 0) { custInvoiceTable.OrderAccount = custTable.AccountNum; custInvoiceTable.modifiedField(fieldNum(CustInvoiceTable, OrderAccount)); custInvoiceTable.InvoiceId ='test04'; custInvoiceTable.insert(); lineNum = 0; } if (custInvoiceTable.RecId != 0) { custInvoiceLine.initFromCustInvoiceTable(custInvoiceTable); // LedgerDimension=Dimensionstorage::accountNum2LedgerDimension("30104000",LedgerJournalACType::Ledger); custInvoiceLine.LedgerDimension = LedgerDimension2;//5637146102; custInvoiceLine.Description = ''; custInvoiceLine.TaxGroup = ''; ...