Monday, February 22, 2021

Check If sales order amount is paid or not in D365fo

 Hi guys, Today we see how to Check If sales order amount is cleared or not in D365fo.


Check below job.

static void checkAmount(Args _args)

{

    CustInvoiceJour  inv;

    CustTrans   custTrans;

    Salestable    salestable;


    Select salestable

        join inv where salestable.SalesId == inv.SalesId

        && salestable.SalesId == '000691'

        && salestable.SalesStatus == SalesStatus::Invoiced

        join custTrans where custTrans.Voucher == inv.LedgerVoucher

        && custTrans.TransDate == inv.InvoiceDate

        && custTrans.AccountNum == inv.InvoiceAccount

        && custTrans.Invoice == inv.InvoiceId;


    info(strFmt('%1-%2-%3-%4',custTrans.remainAmountCur(),salestableloc.CustAccount,custTrans.Voucher,custTrans.Invoice));

    }


Keep Daxing!!

Saturday, February 6, 2021

Add customized code in sales order confirmation In D365FO

Add customized code in sales order confirmation  In D365FO 


Check below method.


[ExtensionOf(classStr(SalesConfirmJournalPost))]

internal final class TestSalesConfirmJournalPost_Extension

{

    /// <summary>

    /// Chain of Command; after posting, update reallocation records.

    /// </summary>

    protected void endPost()

    {

        next endPost();  

//Try to write here 

    }

}

Keep Daxing!!