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 = '';

Code Sample to Export Assets Master Table Value to CSV in Axapta

This Code Sample to Export Assets Master Table Value to CSV in Axapta. You can take many columns and value from table . This is just an example. Query q; QueryBuildDataSource qbds; QueryBuildRange qbr; QueryRun qr; CommaIO commaIO; FileName fileName; InventTable inventTable; AssetTable AssetTable; ; fileName = "C:\\TestSupport\\" + "ItemDetails1" + ".csv"; //Destination of the file commaIO = new CommaIO(fileName,'W'); q = new Query(); qbds = q.addDataSource(tablenum(AssetTable)); qbr = qbds.addRange(fieldnum(AssetTable,Assetid)); //Range qr = new QueryRun(q); commaIO.write("ItemId","Item Type"); //Header of the CSV File //Loop to insert values in the csv from the table while( qr.next() ) { AssetTable = qr.get(tablenum(AssetTable)); commaIO.write(AssetTable.AssetId,enum2str(AssetTable.AssetType)); break; } WINAPI::shellExecute(fileName);

Cluster Group Error on Dynamics 365 SQL database side | Fail the cluster group on SQL side

Problem: Error on Event Log for Dynamics 365 database side. Clustered role 'D365AG' has exceeded its failover threshold.  It has exhausted the configured number of failover attempts within the failover period of time allotted to it and will be left in a failed state.  No additional attempts will be made to bring the role online or fail it over to another node in the cluster.  Please check the events associated with the failure.  After the issues causing the failure are resolved the role can be brought online manually or the cluster may attempt to bring it online again after the restart delay period. Solution: Following things you can try. 1. Restart all server and check admin user in tempdb databse right after restart if no permission then attach user to tempdb database. 2.Most of the problem resolve on restart of servers. 3. If still issue not solved then After some research, we traced it to the ‘Maximum failures in the specified period’ setting at the cluster g

Today Got Wou-G Certificate from Godrej Infotech Ltd. For good work.

Wow.. Today Got Wou-G Certificate from Godrej Infotech Ltd. For good work.

How to update funding Source for Project Contract in Ax 2012

If you want to  update funding Source for Project Contract in Ax 2012 by code then you can get idea from below code.  These all standard table. ProjFundingSource projFundingSource; ProjInvoiceTable projInvoiceTable; LogisticsLocation logisticsLocation,logisticsLocationNew; ; ttsBegin; while select projInvoiceTable order by ProjInvoiceProjId desc { if(projInvoiceTable.ProjInvoiceProjId != "S_002834") { if(projInvoiceTable.fundingSourceName() != "") { while select forUpdate projFundingSource where projFundingSource.ContractId == projInvoiceTable.ProjInvoiceProjId { projFundingSource.FundingSourceId = projInvoiceTable.fundingSourceName(); projFundingSource.InvoiceLocation = 0; projFundingSource.update(); } } } else break; } ttsCommit;