VERSAGO
All
<p>How to check what action is occurring in a Form in the CustomPreExecute and CustomPostExecute procedures.</p><p>NOTE: This information is intended for administrators that are comfortable working with SQL Server Stored Procedures.</p>
<p>There are three actions that can occur in a Versago Form: Add, Update, and Delete. It is possible to determine what action is occurring based on two variables in the CustomPreExecute or CustomPostExecute stored procedures for the form.</p><p>The first variable is named @ActionType. This variable is automatically populated when a transaction is processed.</p><p>The second variable is named @FormMode. A small bit of code is required to obtain this value. Copy and paste following two lines into the procedure.</p><p>Declare @formmode char(1)<br />SELECT @formmode=frm.value('(twbsformmode)[1]','char(1)') FROM @FormData.nodes('/formData') AS HDR(frm);</p><p>You can now determine the form action based on the following code combinations.</p><p>IF isnull(@FormMode,'A') = 'A' AND @ActionType = 'S' the record is being added.<br />IF isnull(@FormMode,'A') = 'F' AND @ActionType = 'S' the record is being updated.<br />IF isnull(@FormMode,'A') = 'F' AND @ActionType = 'D' the record is being deleted.</p><p>The “IF” statements can be used in the form's CustomPreExecute procedure to prevent certain actions from occurring before the form record is actually processed.</p><p>The same logic can also be used in the form's CustomPostExecute procedure to take other actions like posting information to a logging database, triggering a Bizweaver workflow, etc. Keep in mind that the posting has already occurred when the CustomPostExecute procedure is executed.</p>
HowTo
25 Apr 2018