Setting sales Order Line QuantityOrdered in LineAdded failed  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Setting sales Order Line QuantityOrdered in LineAdded failed

Postby indikad » Fri Aug 14, 2015 3:17 pm

Hi anyone ,

is this a bug ?

I see its possible to change the QuantityOrdered in sales order line - within the event "SalesOrderLineAdded"
however my code below just gets ignored ( no errors just jiwa does not respond to it )
I can however edit other fields using similar syntax - but not this field.

I am on 7.0.127

Code: Select all
'--- none of the Two below works
Item.QuantityOrdered = decTotalCubicVol
Item.QuantityOrdered = 2


Thanks in advance.
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Setting sales Order Line QuantityOrdered in LineAdded fa  Topic is solved

Postby Mike.Sheen » Tue Aug 18, 2015 4:46 pm

indikad wrote:Hi anyone ,

is this a bug ?

I see its possible to change the QuantityOrdered in sales order line - within the event "SalesOrderLineAdded"
however my code below just gets ignored ( no errors just jiwa does not respond to it )
I can however edit other fields using similar syntax - but not this field.

I am on 7.0.127

Code: Select all
'--- none of the Two below works
Item.QuantityOrdered = decTotalCubicVol
Item.QuantityOrdered = 2


Thanks in advance.


That event is the same event as the SalesOrderLines.Added event and this is raised after adding the item to the sales order lines collection, but before the quantity is set - so if you do set the quantity in there then it will get overwritten.

Listen to the AddInventoryItemEnd event of the SalesOrderLines collection instead, and then you will be able to change the quantity fields and have the changes stick.
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Setting sales Order Line QuantityOrdered in LineAdded fa

Postby indikad » Tue Aug 18, 2015 5:05 pm

Thanks for this tip Mike.

I am setting few other fields too ( in Line added even) - such as the Cubic and userdefinedFloats. So I guess it would be a good idea to move all logic to the
AddInventoryItemEnd event ?
indikad
Frequent Contributor
Frequent Contributor
 
Posts: 182
Joined: Thu Jun 18, 2009 1:14 pm
Topics Solved: 2

Re: Setting sales Order Line QuantityOrdered in LineAdded fa

Postby Mike.Sheen » Wed Aug 19, 2015 7:44 pm

indikad wrote:I am setting few other fields too ( in Line added even) - such as the Cubic and userdefinedFloats. So I guess it would be a good idea to move all logic to the
AddInventoryItemEnd event ?


You may not need to, but it would not do any harm to use that event instead - unless you have other handlers on the change event on a line which you may only want to be fired when a user is editing those fields - but there are ways to deal with that also (removing handlers at appropriate events and then re-adding them)
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: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 4 guests