22 March 2018

Update the vendor open trans to mark and update the amount in ax 2012 or AX 7 and D365


VendTransOpen vendTransOpenLoc;
VendTrans vendTransLoc;
SpecTransManager specTransManager;
boolean found;
SpecTrans specTransLoc;
CustVendOpenTransManager managerLoc = CustVendOpenTransManager::construct(ledgerJournalTrans);

select firstonly vendTransLoc
where vendTransLoc.Invoice == ledgerJournalTrans.Invoice
join firstonly vendTransOpenLoc
where vendTransOpenLoc.RefRecId == vendTransLoc.RecId;
specTransManager = SpecTransManager::construct(ledgerJournalTrans);
found = SpecTrans::existByRef(vendTransOpenLoc.DataAreaID,tableNum(VendTransOpen),vendTransOpenLoc.RecId);

if(found == false)
{
managerLoc.updateTransMarked(vendTransOpenLoc,NoYes::Yes);
ttsbegin;
specTransLoc = SpecTrans::findByRef(vendTransOpenLoc.DataAreaID,tableNum(VendTransOpen),vendTransOpenLoc.RecId,true);
specTransLoc.Balance01 = -ledgerJournalTrans.AmountCurDebit;
specTransLoc.update();
ttscommit;
}
else
{
warning(strFmt("%1 Record already marked.",ledgerJournalTrans.Invoice));
}

1 comment:

  1. Inspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
    Software Testing Training in Chennai
    SEO Training in Chennai
    Informatica Training in Chennai
    Digital Marketing Training in Chennai

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...