Posts

Charges creation before sales invoice posting

 /// <summary> ///  /// </summary> [ExtensionOf(classStr(SalesInvoiceJournalCreate))] final class SalesInvoiceJournalCreate_Extension {     public void run()     {         SalesParmTable                  salesParmTable;         SalesParmUpdate                 salesParmUpdate;         CustParameters                  custParameters = CustParameters::find();         if (custParameters.AdvanceStampDutyManagement_Custom)         {             SalesTotals     salesTotals;             TmpTaxWorkTrans tmpTaxWorkTrans;             MarkupTrans     markupTrans;             Sales...

Charges creation before free text invoice posting

 /// <summary> /// Create chages for free text invoices. /// </summary> [ExtensionOf(classStr(CustPostInvoiceJob))] final class CustPostInvoiceJob_Extension {      /// <summary>      ///       /// </summary>     public void run()     {         CustInvoiceTable                    custInvoiceTableLoc;         CustParameters                      custParameters = CustParameters::find();         MarkupTrans                         markupTrans;         if (custParameters.AdvanceStampDutyManagement_Custom)         {             CustFreeInvoiceCalcTotals   custFreeInvoiceCalcTotals;   ...

Create ledger dimension from main account

From Bank account :   offsetLedgerDim = DimensionStorage::getDynamicAccount( ‘USMF',LedgerJournalACType::Bank); From Main account : DimensionDynamicAccount DimensionDynamicAccount; DimensionDynamicAccount = LedgerDynamicAccountHelper::getDynamicAccountFromAccountNumber("000103", LedgerJournalACType::Ledger); Likewise the second parameter can be changed to get the ledger dimension from the different account types.

Finding unit price of item from trade agreement through code AX X++

Step 1 : Prepare paramters for finding the unit price   protected PriceDiscParameters createAndInitPriceDiscParameters()     {         PurchLine purchLine = this.getPurchLine();         PurchTable purchTable = purchLine.purchTable();         PriceDiscParameters parameters = PriceDiscParameters::construct();         parameters.parmModuleType(ModuleInventPurchSales::Sales);         parameters.parmItemId(purchLine.Itemid);         parameters.parmInventDim(purchLine.inventDim());         parameters.parmUnitID(purchLine.PurchUnit);         parameters.parmPriceDiscDate(today());         parameters.parmQty(1);         parameters.parmAccountNum(purchTable.OrderAccount);         parameters.parmCurrencyCode(purchLine.CurrencyCode);         return...

Sales return registration through code

   public boolean createSalesReturnRegistration(SalesTable _salesTable)     {         SalesLine                           salesLine;         SalesReturnOrderLineRegister        salesReturnOrderLineRegister;         TradeOrderLineRegister              tradeOrderlineRegister;         InventTrans                         inventTrans;         inventTransOrigin                   inventTransOrigin;         TmpInventTransWMS                   TmpInventTransWMS;         InventTransWMS_Register             inventTransWMS...

Admin provisioning tool error (Cannot stop DynamicsAxBatch service on computer)

  Admin User Provisioning Tool Error: If the Admin User Provisioning Tool gives error that  can’t stop DynamicsAxBatch . Go to the  Services , Find out the service with the name:  Microsoft Dynamics 365 Unified Operations: Batch Management Service Stop  it. Now  register with the admin provisioning tool If you are unable to stop the  DynamicsAxBatch Service from services . Then do the following steps in it: Run a  command prompt as administrator . Execute command:  sc queryex [servicename] . Press Enter Note: Service name:   DynamicsAxBatch Command:   sc queryex DynamicsAxBatch Find out the  PID  from the result of the query. Write it down to use in next step In the same command prompt, execute command:  taskkill /f /pid [pid number] . Press Enter Note: Example PID: 2145 Command:   taskkill /f /pid 2145 Now,  register yourself in the Admin Provisioning Tool.  It will not give error.

CoC of Pack() & unPack() For Batch Classes And Adding Variables In Standard Macro

[ExtensionOf(classStr(ReqTransPoMarkFirm))] final class MyReqTransPoMarkFirm_Extension {     private NoYesId             booleanGroupBy;       #DEFINE.CurrentVersion(17)     #LOCALMACRO.CurrentList         booleanGroupBy     #ENDMACRO       public container pack()     {         container packedClass = next pack();         return SysPackExtensions::appendExtension(packedClass, classStr(MyReqTransPoMarkFirm_Extension), this.myPack());     }     private boolean myUnpack(container packedClass)     {         Integer version = RunBase::getVersion(packedClass);         switch (version)         {             case #CurrentVersion:                 [versio...