Alfasith AX

Alfasith AX
اللَّهُمَّ انْفَعْنِي بِمَا عَلَّمْتَنِي، وَعَلِّمْنِي مَا يَنْفَعُنِي، وَزِدْنِي عِلْمًا

Thursday, June 19, 2014

Calculate SalesTotal class and related information in X++

Hi,

static void SalesTotalAlfasith(Args _args)
{
    SalesTotals   salesTotals;
    SalesTable   salesTable;
    container   displayFields;
    str    totalTax, amountWithoutTax, amountInclTax;

    salesTable = salesTable::find('SO-101269');
    salesTotals  =  SalesTotals::construct(salesTable, salesUpdate::All);
    salesTotals.calc();
    displayFields =  salesTotals.displayFieldsCurrency(salesTotals.currencyCode());

    print   conpeek(displayFields, TradeTotals::posBalance());
    print   conpeek(displayFields, TradeTotals::posEndDisc());
    print   conpeek(displayFields,TradeTotals::posTaxTotal());
    pause;
}

Regards,

Calculate PurchTotal class and its related information in X++

Hi,

static void PurchTotalAlfasith(Args _args)
{
    PurchTotals   purchTotals;
    PurchTable   purchTable;
    container   displayFields;
    PurchtotalsForm         totalsForm;
    purchTable = PurchTable::find('000396');          
    totalsForm   = PurchtotalsForm::newPurchTotalsForm(purchTable, 1);
    totalsForm.calctotals();
    print " Total quantity = %1", totalsForm.qtyValue();
    print " Total Discount = %1",totalsForm.endDiscValue();
    print " Total Chanrges = %1",totalsForm.sumMarkUpValue(); // this includes all the freight charges..
    print " Total Invoiced = %1",totalsForm.invoiceAmountValue();
    print " Sub total      = &1",totalsForm.sumLinesValue();
    pause;
}

Regards,

SQL code to upate one Legal entity banner to all the legal entity in D365

 Hi, update companyimage set  companyimage.Image  = companyimageA.Image  from  ( select Image from companyimage where dataAreaid = 'USF...