Whenever a sales rep creates a sales order and add an item to the line, I would like to check whether or not a trade agreement exists for that particular item. If one does exist then I would like for on the Discount and Discount percentage on the SalesLine to be disabled so the user cannot input a further discount amount. How can I do that?
Hi Kchle, There are some methods in the PriceDiscTable (those prefixed with “exist…”), you can use those methods to check whether a trade agreement exist. Hope that helps.
Hi You can figure out what the system does by getting deeper into e.g. the modified method on the Qty field of the Datasource SalesLine in the SalesTable form. Form that you will come to some Map methods where the actual searching of the PriceDisc is done. You can also search for “PriceDisc” on the SalesTable form or the SalesLine table (or the SalesPurchLine Map).
Also I need to take the date into consideration. That is, I need to check if the date is valid for that particular trade agreement. So if the date has passed then the trade agreement no longer exists and then the sales rep can add a discount. Would that mean I have to modify the map?
To give you a hint, look at PriceDiscTable’s existAccountItemDateRelation method.