This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
versago3:from_sp [2022/11/01 11:35] dlee created |
versago3:from_sp [2024/04/09 14:33] (current) dlee |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Custom | + | ====== Custom |
| There are two custom procedures available for use. These procedures are automatically created when a new form is created. | There are two custom procedures available for use. These procedures are automatically created when a new form is created. | ||
| Line 59: | Line 59: | ||
| To work with the appropriate dataset, it is necessary to first get the record key from the form data. Following is the basic SQL statement to set a processing variable to the record number (vgoRecNum) value on a form. “vgoRecNum” is the column name used for this example. The value used in your form may be different. | To work with the appropriate dataset, it is necessary to first get the record key from the form data. Following is the basic SQL statement to set a processing variable to the record number (vgoRecNum) value on a form. “vgoRecNum” is the column name used for this example. The value used in your form may be different. | ||
| - | < | + | < |
| + | Sample SQL to extract fields from xml parameter | ||
| - | SELECT @vgoRecNum | + | DECLARE @formmode char(1), |
| + | @text nvarchar(50), | ||
| + | @number numeric(19, | ||
| + | @date datetime | ||
| + | |||
| + | SELECT @formmode | ||
| + | @text = frm.value(' | ||
| + | @number = frm.value(' | ||
| + | @date = frm.value(' | ||
| + | FROM @FormData.nodes('/ | ||
| + | |||
| + | FormField1, ..2, ..3 must match the Field Name in the form control settings. It is case sensitive | ||
| + | |||
| + | --------------------------------------------------------------------------------------- | ||
| + | |||
| + | Sample SQL to extract fields from xml parameter @GridData (Detail table) | ||
| + | |||
| + | SELECT frmdetail.value(' | ||
| + | frmdetail.value(' | ||
| + | frmdetail.value(' | ||
| + | INTO # | ||
| + | FROM @GridData.nodes('/ | ||
| + | |||
| + | FormField1, ..2, ..3 must match the Field Name in the form control settings. It is case sensitive | ||
| + | Use SQL cursor to process each record | ||
| </ | </ | ||
| Line 81: | Line 106: | ||
| You can now determine the form action based on the following code combinations. | You can now determine the form action based on the following code combinations. | ||
| - | IF isnull(@FormMode,' | + | IF isnull(@FormMode,'' |
| - | IF isnull(@FormMode,' | + | IF isnull(@FormMode,'' |
| - | IF isnull(@FormMode,' | + | IF isnull(@FormMode,'' |
| The “IF” statements can be used in the form’s Custom_PreExecute procedure to prevent certain actions from occurring before the form record is posted. The same logic can also be used in the form’s Customer_PostExecute procedure to take other actions, like posting information to logging columns in the record or to a logging table, triggering a Bizweaver workflow, etc. Keep in mind that the updated record has already been posted when the Custom_PostExecute procedure is executed. | The “IF” statements can be used in the form’s Custom_PreExecute procedure to prevent certain actions from occurring before the form record is posted. The same logic can also be used in the form’s Customer_PostExecute procedure to take other actions, like posting information to logging columns in the record or to a logging table, triggering a Bizweaver workflow, etc. Keep in mind that the updated record has already been posted when the Custom_PostExecute procedure is executed. | ||