Update the price in Trade agreement journals

Hi All,

I am creating the Trade agreement price journals using DIXF.

My issue is as described below:

I have a flag in my file, if that flag value is true, then

  • the process will check if the value of the flag “XXX” is = true. If it is “true”, the interface will retrieve all the existing prices for the same combination (Item-Vendor/Customer-Currency-Unit-Inventory Dimension-Quantity) where “To Date” = blank and will create a line in the trade agreement journal to update the existing price with “To Date” = ((importing price “From Date”) -1).

  • the process will insert a new record in the Journal to import the new price.

Best Regards

Pranav.

Hi All,

I have resolved the issue.

Below is the code for DIXF Class:

In the InsertUpdate method of “DMFPriceDiscAdmTransEntityClass” i.e. standard DMF class for TradeAgreement journals

update the standard code as below:

// N Developed by v-prangu for CBD_IN_015_TRA_TradeAgreements on 09/07/2015

public

Common insertUpdate(Common _target, boolean _callInsertLogic = false, boolean _callValidateLogic = false)

{

Common ret;

PriceDiscAdmTrans priceDiscAdmTransLoc;

InventDim inventdimLoc;

PriceDiscJournalName priceDiscJournalName;

PriceDiscTable priceDiscTable;

if (entity.MyFlag== 0(true))

{

select forUpdate

priceDiscAdmTransLoc

join

inventdimLoc

where

priceDiscAdmTransLoc.ItemRelation == entity.ItemRelation &&

priceDiscAdmTransLoc.AccountRelation == entity.AccountRelation &&

priceDiscAdmTransLoc.Currency == entity.Currency &&

priceDiscAdmTransLoc.UnitId == entity.UnitId &&

priceDiscAdmTransLoc.QuantityAmountFrom == entity.QuantityAmountFrom &&

priceDiscAdmTransLoc.QuantityAmountTo == entity.QuantityAmountTo &&

priceDiscAdmTransLoc.ToDate == dateNull() &&

priceDiscAdmTransLoc.InventDimId == inventdimLoc.inventDimId &&

inventdimLoc.InventSiteId == entity.InventSiteId &&

inventdimLoc.InventLocationId == entity.InventLocationId ;

select OriginalPriceDiscAdmTransRecId, RecId from

priceDiscTable

where

priceDiscTable.OriginalPriceDiscAdmTransRecId == priceDiscAdmTransLoc.RecId;

priceDiscJournalName = PriceDiscAdmTable::find(priceDiscAdmTransLoc.JournalNum).JournalName;

this.MyMakeJournal(priceDiscJournalName, priceDiscTable.RecId); //Create a new method, code for this is after in the end.

}

if (entity.AccountRelation && entity.MyFlag!= 0(true))

{

if

(VendTable::find(entity.AccountRelation).AccountNum)

{

target.relation = PriceType::PricePurch;

_target = target;

}

else if

(CustTable::find(entity.AccountRelation).AccountNum)

{

target.relation = PriceType::PriceSales;

_target = target;

}

}

if (entity.MyFlag == 1)

{

ret =

super

(_target, _callInsertLogic, _callValidateLogic);

}

return

ret;

}

public

void

CBDMakeJournal(

PriceDiscJournalName _priceDiscJournalName,

recId _priceDisctableRecId)

{

PriceDiscTable priceDiscTable;

PriceDiscAdmTrans priceDiscAdmTrans;

RecordInsertList priceDiscAdmTransInsertList =

new RecordInsertList(