Use the w_master pfc_Save eventTag(s): PFC


The w_master pfc_Save event will update all "self_updateable" objects. u_dw is self updateable by default but you must of_SetUpdateable(TRUE) n_ds, u_lvs, u_tab and u_tcs objects to enable this feature. Each these self-updatable objects have their own events that will be called by the w_master pfc_Save event. Here is the event sequence that will occur during a pfc_Save

pfc_AcceptText execute an AcceptText on all self-updating objects
pfc_UpdatesPending Check if there is any self-updating object that need to be updated
pfc_Validation
extend on the object
performs validation on the object level
returns SUCCESS if ok, FAILURE otherwise.
For non-PFC object, create an user event
called ue_validation which returns an integer
greater or equals to 0 for SUCCESS.
pfc_UpdatePrep
extend on the window
Empty event, use to prepare an update
pfc_PreUpdate
extend on the window or control
Empty event
more validations if necessary,
return SUCCESS to continue the pfc_Save process or
FAILURE to abort
pfc_BeginTran
extend on the window
Empty event
code the transaction beginning, returns
SUCCESS to continue the update
pfc_Update
extend on the window
Do the update on the self-updating objects.
For non-self-updating object, you can code here
the update procedure. Returns SUCCESS or FAILURE.
If it's a failure, use of_SetDBErrorMsg() to set an appropriate
error message (it will displayed by the pfc_DBError error).
pfc_EndTrand
extend on the window
Empty event
Here you can code the SQLCA.of_Commit() or SQLCA.of_Rollback()
depending on the savecode (an event parameter) value.
pfc_DBError
extend or overrride on the window
If an error occurs, this event will occur.
pfc_PostUpdate
extend on the window or control
Reset update flags on the self-updateable objects

blog comments powered by Disqus