SalesOrder.SaveEnd event not quite end  Topic is solved

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

SalesOrder.SaveEnd event not quite end

Postby perry » Mon Mar 30, 2015 3:46 pm

Hi,

I'm coding an auto print function on creation (first save) of a new sales order (business logic only plugin).
I tried SOObject.Print(reports_collection) function inside the SaveEnd event and it is throwing an error which says sales order has to be saved first.

The work around is to use the ReadEnd event which gets called right after Save().

Will you log this as a bug fix or I should keep using my work around?
The trouble for us is if SO is created outside JIWA, we normally don't call SO.Read(id) after salesOrder.OnSaveEnd(). We will need to recompile those apps.

Regards,
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: SalesOrder.SaveEnd event not quite end  Topic is solved

Postby Mike.Sheen » Mon Mar 30, 2015 9:09 pm

Hi Perry,

To print, the sales order must be saved - the report uses the table data, not the business logic data to report on - and this is by design to mitigate fraud (someone printing a delivery docket, then editing the order and thus allowing goods to leave the warehouse without an audit).

Your technique of using the ReadEnd event to print is fine, if that works for you then you should continue to use it. As you've probably worked out, a print will cause a save (we need to log who printed what), and thus another read event - it might seem inefficient, but we need to follow that sequence of events for audit and fraud prevention purposes.

Mike
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 0 guests