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

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.