| Home | Previous Lesson: Most Recently Used Object Service Next Lesson: pfc_PreMRUSave |
MRU service maintains a DataStore internally and maintains all the MRU data in that DataStore. MRU service updates this DataStore when you register/un-register an object for MRU service and every time you add a menu item under any group ID.
When triggered, this event will add the current window to the MRU list. Do not confuse this event with saving the information into the .INI file or the registry. The MRU service will do that on the application close. This event is used to tell the service to update its DataStore. Possible choices to fire this event are Open, Save, or Close related events. You do not need to add any code to the pfc_MRUSave event; If you browse the code for this event in pfc_w_master window (code is listed below), you will see that this event is firing the pfc_PreMRUSave event.
// Pre-Written code
// Object: pfc_w_master
// Event: pfc_MRUSave
n_cst_mruattrib lnv_mruattrib
// add information to mru nvo service
If IsValid(gnv_app.inv_mru) Then
// execute user defined save logic
this.event pfc_premrusave(lnv_mruattrib)
// id must be registered with mru service first
if gnv_app.inv_mru.of_IsRegistered(lnv_mruattrib.is_id) then
Return gnv_app.inv_mru.of_additem(lnv_mruattrib)
else
Return -1
end if
end if
return -1
Write the following code in the w_product_master window.
this.Event pfc_MRUSave()
| Home | Previous Lesson: Most Recently Used Object Service Next Lesson: pfc_PreMRUSave |