Page 1 of 1

Sales order line, check if price from Debtor Specific Prices

PostPosted: Mon Apr 20, 2026 11:26 pm
by DannyC
I want to know the source price on each line of a sales order, e.g. debtor classification price, debtor specific price, default inventory price, group matrix price etc.

This line works when a new line is added to a sales order
Code: Select all
JiwaFinancials.Jiwa.JiwaPriceSchemes.ReturnedPrice returnedPrice = (JiwaFinancials.Jiwa.JiwaPriceSchemes.ReturnedPrice)soLine.PriceSelected;

but if I want to iterate through the line collection after a sales order is saved such as on the ReadEnd event, then it looks like
Code: Select all
soLine.PriceSelected
is null.

How can I determine if a sales order line price has been sourced from Debtor Specific Prices or any other price scheme element?

Re: Sales order line, check if price from Debtor Specific Pr

PostPosted: Tue Apr 21, 2026 6:47 am
by SBarnes
Whilst Scott or Mike may be able to suggest a better way to do this you could try calling RecalculatePrice on each line as that seems to set PriceSelected.

Re: Sales order line, check if price from Debtor Specific Pr  Topic is solved

PostPosted: Thu Apr 23, 2026 6:20 pm
by Mike.Sheen
DannyC wrote:but if I want to iterate through the line collection after a sales order is saved such as on the ReadEnd event, then it looks like
Code: Select all
soLine.PriceSelected
is null.

How can I determine if a sales order line price has been sourced from Debtor Specific Prices or any other price scheme element?


We don't persist to the database where the price came from - so create a custom field for the line to store the source of the price, and on the added event for the line, populate the custom field from the soLine.PriceSelected.

It won't help for existing orders already saved, but moving forward it will allow you to see the origin of the price.

Re: Sales order line, check if price from Debtor Specific Pr

PostPosted: Fri Apr 24, 2026 3:28 pm
by DannyC
create a custom field for the line to store the source of the price


Stuart & I were just discussing the exact same.

Good to get some validation.

Thanks