Sunday 28 June 2020

D365 TABLE INITVALUE EVENT HANDLER CODE X++

TABLE INITVALUE DATASOURCE PRE AND POST EVENT HANDLERS FOR INIT METHOD
Write the below code in the form extension class

   /// <summary>
    ///
    /// </summary>
    /// <param name="args"></param>
    [PostHandlerFor(tableStr(SalesTable), tableMethodStr(SalesTable, initValue))]
    public static void SalesTable_Post_initValue(XppPrePostArgs args)
    {
        SalesTable SalesTable = args.getThis() as SalesTable;
        SalesTable.test_PrintNote=NoYes::Yes;
    }

Trade Agreement Purchase price in D365 AX 2012 code

Trade Agreement Purchase price in D365 AX 2012 code :

You can use the below code to find the current trade aggrement price of a given item for a Purchase order.

public static Price findPurchasePrice(ItemId _itemId, VendAccount _vendAccount, InventDimId _inventDimId, Qty _qty) { PriceDisc priceDisc; InventTable inventTable = InventTable::find(_itemId); VendTable vendTable = VendTable::find(_vendAccount); //InventDim inventDimItem = inventTable.inventItemInventSetup().inventDim(); InventDim inventDimItem = InventDim::find(_inventDimId); UnitOfMeasureSymbol unitId = inventTable.inventTableModuleInvent().UnitId; Price retPrice; priceDisc = new PriceDisc(ModuleInventPurchSales::Purch, _itemId, inventDimItem, unitId, systemDateGet(), _qty , _vendAccount); if (priceDisc.findPrice(_vendTable.PriceGroup)) retPrice = priceDisc.price(); else if (priceDisc.findItemPrice()) retPrice = priceDisc.price(); return retPrice; }

FOR SALES REPLACE PURCH WITH SALES AND VENDOR WITH CUSTOMER.....

thanks,
Vikas Mehta.

AZURE INTERVIEW QUESTIONS AND ANSWERS

AZURE INTERVIEW QUESTIONS AND ANSWERES 2021 2. What is cloud computing? Explanation:  It is the use of servers on the internet to “store...