Passing Information Between Events on Sales Order  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Passing Information Between Events on Sales Order

Postby SBarnes » Fri Aug 05, 2016 9:37 am

Hi Guys

I want to be able to capture information on the creation of an order and then use this information when the order is saved, I am able to capture the details ok by attaching to the created event of the of the sales order, but how can I then recover this information inside a plugin for each unique order without having to resort to UDFs on the sales order as the data does not need to be stored in the database long term as once the order is saved the data is irrelevant .

The only option I have been able to come with thus far would be some sort of static dictionary or list added to the Business Logic to store the information in memory based upon each sales order at the time and then retrieving it back just before the save.

I suppose I am asking are there any other options?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Passing Information Between Events on Sales Order  Topic is solved

Postby Mike.Sheen » Sun Aug 07, 2016 4:34 pm

SBarnes wrote:how can I then recover this information inside a plugin for each unique order without having to resort to UDFs on the sales order as the data does not need to be stored in the database long term as once the order is saved the data is irrelevant


Our base class for maintenance business logic types have a GenericObjectCollection property. This example plugin uses such a technique.

To store the item:
Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance maintenanceBL = (JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance)JiwaBusinessLogic;
// Add to generic object collection of object a read and a save variable for the start datetimes
JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem readItem = new JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem();
readItem.RecID = "PerformanceMetric_Read_Start_DateTime";         
maintenanceBL.GenericObjectCollection.Add(readItem);

JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem saveItem = new JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem();
saveItem.RecID = "PerformanceMetric_Save_Start_DateTime";         
maintenanceBL.GenericObjectCollection.Add(saveItem);


To retrieve the item:
Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance maintenanceBL = (JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.Maintenance)sender;
JiwaFinancials.Jiwa.JiwaApplication.BusinessLogic.GenericObjectItem readItem = maintenanceBL.GenericObjectCollection["PerformanceMetric_Save_Start_DateTime"];


Does this help ?
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: Passing Information Between Events on Sales Order

Postby SBarnes » Sun Aug 07, 2016 4:59 pm

HI Mike

Thanks for the reply, yes this will probably do exactly what I want I can define an object to hold the three lists I want keep and add it to the collection or alternatively put the three lists in under three unique keys.

I just didn't want to fill the database up with irrelevant data that's not needed once the user has decided what to do and order is saved.

Thanks
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 10 guests

cron