Find the trade agreement from salesline record

How can I get the associated trade agreement from PriceDiscAdmTrans from a particular line in SalesLine table?

Hi Alok.

Did u find solution on above problem.actually i want some field (FromDate,ToDate) of treadAggrement from table PriceDiscAdmTrans to SalesLine table.

Please help me.

thanks anita.

Hi Darshana,

There is no method or anything like that to get the associated record from PriceDiscAdmTrans for a record in SalesLine. You need to create the nested loop to go through each and every row in the SalesLine, and find the matching record in PriceDiscAdmTrans. Please look at the notes below that helped me get to the solution:

Since you are looking at sales order lines first to determine what has been ordered, I believe you would need to capture not only the customer but also the price group in addition to the customer (DiscMarkup_PriceGroupIdSalesTable(SalesTable).PriceGroupId) as well as the item.

If there is a Price(sales) for the item and Account Code = “All” then an agreement exists

or

compare to see if a trade agreement exists for the Customer/Item relationship

or

compare to see if a trade agreement exists for the Price Group/Item relationship

In the Price/discount journal (trade agreement) determine:

If Relation = Price (sales) relationPriceDiscAdmTrans(PriceDiscAdmTrans).relation

and

Account Code = Table, Group or All AccountCodePriceDiscAdmTrans(PriceDiscAdmTrans).AccountCode

and

Item Code = Table ItemCodePriceDiscAdmTrans(PriceDiscAdmTrans).ItemCode

If users set up a trade agreement with an Item Code to anything other than “Table”, this is beyond the scope of this report.

Hope this helps. Let me know if you have more questions.