sales order line change event QuantityThisDelivery  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

sales order line change event QuantityThisDelivery

Postby perry » Thu Aug 25, 2016 6:45 pm

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
Attachments
Plugin SODelivery.xml
(30.93 KiB) Downloaded 118 times
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15

Re: sales order line change event QuantityThisDelivery  Topic is solved

Postby Mike.Sheen » Sat Nov 12, 2016 3:27 pm

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
Attachments
Plugin SODelivery.xml
Modified Plugin
(33.07 KiB) Downloaded 152 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: sales order line change event QuantityThisDelivery

Postby perry » Fri Nov 18, 2016 11:33 am

Thanks!
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15


Return to Technical and or Programming

Who is online

Users browsing this forum: Google [Bot] and 18 guests