Tuesday, October 12, 2021

checks if the invoice is already marked with some payment or not in D365FO using X++

 checks if the invoice is already marked with some payment or not  using X++


    CustTable custTable; CustTrans payCustTrans; CustVendOpenTransManager manager; CustTransOpen custTransOpen; boolean check; ; custTable = CustTable::find(Accnum); select firstonly payCustTrans order by TransDate asc where payCustTrans.AccountNum == custTable.AccountNum && payCustTrans.TransType == LedgerTransType::Payment && !payCustTrans.closed; //!payCustTrans.LastSettleDate; select firstonly custTransOpen where custTransOpen.RefRecId == payCustTrans.RecId && custTransOpen.AccountNum == payCustTrans.AccountNum; if (payCustTrans.RecId && custTransOpen.RecId) { specTransManager specTransManager = specTransManager::construct(custTransOpen); //specTransManager manager = CustVendOpenTransManager::construct(custTable); check = specTransManager.existForOtherSpec(custTransOpen.company(), custTransOpen.TableId, custTransOpen.RecId); // Retun true or false. }


Keep Daxing!!

No comments:

Post a Comment