Wiki

Scale Your Enterprise

User Tools

Site Tools

mbstring extension must be loaded in order to run mPDF

kb:kb_item_340

KB Item 340

Product

VERSAGO

Product Version (if applicable)

All

Issue

<p>How to&nbsp; 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>

Symptom

Cause

Resolution Notes

<p>There are three actions that can occur in a Versago Form: Add, Update, and Delete.&nbsp; 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.&nbsp; This variable is automatically populated when a transaction is processed.</p><p>The second variable is named @FormMode.&nbsp; A small bit of code is required to obtain this value.&nbsp; Copy and paste following two lines into the procedure.</p><p>Declare @formmode char(1)<br />SELECT&nbsp; @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&nbsp;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.&nbsp; Keep in mind that the posting has already occurred when the CustomPostExecute procedure is executed.</p>

KB Type

HowTo

Item Date

25 Apr 2018

kb/kb_item_340.txt · Last modified: 2019/01/24 09:44 (external edit)