prereplace and postreplace

The prereplace function can be used when user clicks the Replace option on the Ingredient Replace form before any replacement.

The postreplace function can be used after the ingredients are replaced.

This example uses these functions to perform the required actions on the Ingredient Replace form.


Option Strict Off
Imports System
Imports System.Data
Imports System.Diagnostics
Imports Formation.Shared.Defs
Class HookScript
Inherits FcProcFuncSetEventHook
Function PreReplace() as Long
Dim status as Integer = ObjProperty("STATUSIND")
if (status = 300)
ObjPropertySet(400, 1, "STATUSIND.STATUS", "", "")
return 111
end if
Return -1
End Function
Function PostReplace() as Long
ObjPropertySet("POSTREPLACE has been run", 1, "REPLACECOMMENT")
Return 111
End Function
End Class