by 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