Finding the relevant Sales/Quotation/Confirmation/Invoice line from a SalesPurchLine
Hey Martin,
THank you for your reply.
Allow me to explain what I wish to do in order to more clearly show my problem:
FUNCTIONAL:
-I want to add a percentual charge field to my SalesQuotationLine, SalesLine, SalesConfimationLine and SalesInvoiceLine.
-This field is uses between some of the standard fields in the calculation for lineAmount
TECHNICAL:
-I figured I had to extend PriceDisc.price2Amount, so I did that
-I this context I had no acces to my custom field, so I checked the callstack and found as caller:
SalesPurchLineInterface.calcPrice2LineAmount, so I extended this one. In the method I save a reference to my custom field, so afterwards, in the pricedisc method, this value can be taken out and used for the calculation.
So I chose the interface extension, since I saw it in the callstack. Afterwards I found the following link, which allowed me to extend the SalesLineSalesPurchLine:
Im not sure if I created a correct and valid implementation like this or if this functionality could be created in a much simpler way