Page 1 of 1

Not changing Quantities Back Ordered on Sales order Line

PostPosted: Sun Sep 25, 2022 12:37 pm
by SBarnes
If on a sales order you call MakeNewSnapshot with no parameters and the try to change Quantity Back Ordered on any line in the sales order, the property is not changed and no error is produced I know why in the logic it is not changing the value because NewManualSnapForDeliveries is then passed in as true but wouldn't this be a bug as the assumption is the code did change the back order quantity?

Re: Not changing Quantities Back Ordered on Sales order Line

PostPosted: Tue Sep 27, 2022 3:36 pm
by Mike.Sheen
SBarnes wrote:wouldn't this be a bug as the assumption is the code did change the back order quantity?


What code changed the backorder quantity?

When invoking MakeNewSnapshot, if the optional parameter NewManualSnapForDeliveries is not supplied, or is true, then we allow the increase of the delivery quantity.

If MakeNewSnapshot was invoked with the parameter set to false, then we allow the decrease of back orders to effectively cancel the back orders.

Re: Not changing Quantities Back Ordered on Sales order Line

PostPosted: Tue Sep 27, 2022 3:38 pm
by SBarnes
The code was changing the back order quantity to zero, my point is it looks like its made the change when it hadn't

Re: Not changing Quantities Back Ordered on Sales order Line

PostPosted: Tue Sep 27, 2022 3:40 pm
by Mike.Sheen
SBarnes wrote:The code was changing the back order quantity to zero


We don't let you set the back order quantity if MakeNewSnapshot was invoked with NewManualSnapForDeliveries set to true.

Invoking NewManualSnapForDeliveries with NewManualSnapForDeliveries will allow the cancelling of backorders.

Re: Not changing Quantities Back Ordered on Sales order Line

PostPosted: Tue Sep 27, 2022 3:42 pm
by SBarnes
Yes I know but should the code throw an exception for the not allowed change, otherwise from the outside it looks like it has done it?

Re: Not changing Quantities Back Ordered on Sales order Line  Topic is solved

PostPosted: Tue Sep 27, 2022 3:50 pm
by Mike.Sheen
SBarnes wrote:Yes I know but should the code throw an exception for the not allowed change, otherwise from the outside it looks like it has done it?


We behave that way to suit the users of the user interface.

Forms and API both use the underlying business logic, and we sometimes do silently change / modify things when the user keys it in instead of throwing an error, as the users don't like error messages - and we do this change / modifying inside the business logic.

We could add logic into the UI to anticipate when this would cause an exception (such as setting min or max values for the grid cells), and then also modify the business logic to throw an exception instead of ignoring / adjusting, or we could catch specific exceptions in the UI and swallow them - but logic or complexity in general in the UI isn't something I'm terribly fond of - I'd much rather it just be a really dumb presentation layer.

I'd also rather not have the silly rule that the user needs to know when creating a new snapshot if it is to cancel backorders or fulfill the backorders - just let them do either!