Page 1 of 1

sales order line change event QuantityThisDelivery

PostPosted: Thu Aug 25, 2016 6:45 pm
by perry
Hi,
Jiwa 7.0.157

The requirement is to not pushing Order Qty if "Qty This delivery" is creased. e.g. Ordered:9 and this del:9, do not allow if user change this del to 10.

Code: Select all
Private Sub SOLineChanged(line As JiwaSales.SalesOrder.SalesOrderLine, e As System.ComponentModel.PropertyChangedEventArgs)
            If e.PropertyName.Equals("QuantityThisDelivery") Then
                'PM 2013-07-26, ticket 28512, do not allow delivery qty greater than order qty.
                If line.QuantityOrdered > line.QuantityOriginalOrdered Then
                    line.QuantityOrdered = line.QuantityOriginalOrdered
                End If
            End If
        End Sub


Issue,
Plugin cannot tell what field has been changed, "QuantityOrdered" or "QuantityThisDelivery".
Property "QuantityThisDelivery" change event is called even if "Quantity Ordered" is changed, i.e. user changes order qty on the form rather than qty this del.

Sample plugin attached

Re: sales order line change event QuantityThisDelivery  Topic is solved

PostPosted: Sat Nov 12, 2016 3:27 pm
by Mike.Sheen
Hi Perry,

Yes - this is a bit of an issue as the property setter for QuantityThisDelivery will invoke the notify property changed for QuantityOrdered and vice-versa.

As you're only interested in this via the user keying in data, and not a wide ranging business logic rule, hooking in to the grid change event before the Jiwa form does will allow you to cancel the change.

Attached is a modified version of your supplied plugin which does this.

Mike

Re: sales order line change event QuantityThisDelivery

PostPosted: Fri Nov 18, 2016 11:33 am
by perry
Thanks!