Posts

How to create and use display methods in grid D365

 First Create a class e.g  Class_Extension - Public static class PurchTable_Extension - Class and methods should be static   - Add display keyword before method signature - Add your logic and queries in the function - datasource _this gives you the current data of the line.  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Usage: - In grid, add a field, open properties, and select data source e.g; purchTable, and then select   data method like this:    PurchTable_Extension :: PurchCharges xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Class: public static class PurchTable_Extension {    [SysClientCacheDataMethodAttribute(true)]  //This attribute will cache your display method.    public static display AmountCur PurchCharges ( PurchTable _this )    { PurchTotals purchTotals;  / /Calculate totals per Purchase order PurchTable  purchTable  = PurchTable::find(_this.PurchId); / /Change ...

how to get totals of sales order and purchase order

  public real SalesTotal(str salesId )     {         SalesTotals salesTotals;         SalesTable salesTable;         SalesLine salesLine;         TaxAmountCur salesAmt, taxAmount, amt1, discountAmt, totcharges, totOfOrder,                          contributionRatio;         Tax tax;         salesTable = SalesTable::find( salesId );   //give sales id here          salesLine = SalesLine::find(salesTable.SalesId);         salesTotals = SalesTotals::construct(salesTable);         tax = Tax::construct(NoYes::No);         salesAmt    = salesTotals.totalBalance();         taxAmount   = salesTotals.totalTaxAmount();         discountAmt = sal...