My goal is to delete all the active Sell Trade Agreements a product might have. For that, I have written the following code.
The problem is that it marks the records in "PriceDiscAdmTrans" table for deletion but it doesn't post a new journal to accomplish the task.
I can see the Log field in this table changes to "Marked for deletion - the agreement was never posted."
Would you please help me out with this issue?
PriceDiscAdmTrans priceDiscAdmTrans; PriceDiscAdmDeleteTradeAgreements priceDiscAdmDeleteTradeAgreements = PriceDiscAdmDeleteTradeAgreements::construct(); PricePriceDiscJournal PriceDiscJour; JournalId journalNum; PriceDiscAdmCheckPost priceDiscAdmCheckPost = new PriceDiscAdmCheckPost(false);//To make sure posting is happen PriceDiscJour = new PricePriceDiscJournal(); select * from priceDiscAdmTrans where priceDiscAdmTrans.RecId == 5641684076; journalnum = pricediscadmdeletetradeagreements.parmpricediscadmtrans(pricediscadmtrans).journalnum; pricediscadmdeletetradeagreements.run(); info(strfmt("%1", journalnum)); pricediscadmcheckpost.initjournalnum(journalnum); pricediscadmcheckpost.run();