Roger Blanchard
447 posts
Registered:
29 Jun 2018
22 Jan 2019
in reply to
Mike Fechner
Link to this post
Thanks Mike, I have added the following code to the OspreyViewer. It works great and can be enabled by a property on the viewer.
thanks.
METHOD OVERRIDE PROTECTED VOID OnBeforeEnableFields( INPUT e AS Consultingwerk.CancelableEventArgs ):
DEFINE VARIABLE oAdapter AS SmartBusinessEntityAdapter NO-UNDO.
IF VALID-OBJECT (THIS-OBJECT:SmartDataSource) AND THIS-OBJECT:RefetchCurrentRowOnUpdate THEN
DO ON ERROR UNDO, THROW:
oAdapter = CAST (THIS-OBJECT:SmartDataSource, SmartBusinessEntityAdapter).
IF VALID-OBJECT (oAdapter) AND NOT oAdapter:IsRowUncommittedAdd() THEN
oAdapter:RefetchCurrentRow().
CATCH eError AS Progress.Lang.Error:
LogManagerWrapper:WriteError(eError).
END CATCH.
END.
SUPER:OnBeforeEnableFields(INPUT e).
END METHOD.