Overview
When you run a Single Row Maintainer the default action mode is set to Add. However, what if you want your maintainer to add or update, based on which link a user clicks? Rather than making three separate applications, you can control the action of the maintenance application based on aURL parameter.
Action Modes
Use the URL parameter “action_mode” and values: ‘add’, ‘update’, ‘delete’, ‘copy’, and ‘view’ to control the action mode like so:
DICTIONARY.M00010s?action_mode=add
If using any action mode other than ‘Add’ you are required to also pass the dimension key field(s) as parameters to know which record to pull back.
DICTIONARY.M00010s?action_mode=update&CNUM=100001
Fields may be pre-populated in the form by passing the field name and the desired value through the URL, like so:
DICTIONARY.M00010s?action_mode=update&CNUM=100001&CSTATE=CO
Add Mode
By default, Single Row Maintainers are set to Add mode. However, you may still use the action_mode parameter.
DICTIONARY.M00010s?action_mode=add
Because the maintainer is in add mode, the form has blank inputs (aside from the Customer # dimension key which is set to auto-sequence) ready for data entry.
Again, input fields can be pre-populated in the form by passing the field name and value as a parameter:
DICTIONARY.M00010s?action_mode=add&CSTATE=CO
Update Mode
DICTIONARY.M00010s?action_mode=update&CNUM=100001
Notice that this link automatically ran the application, pulled back the record where the key field (CNUM) is equal to “100001” and now allows the user to update any field other than the key field. In update mode, the dimension key(s) will always be read-only.
Delete Mode
DICTIONARY.M00010s?action_mode=delete&CNUM=100001
This link also runs the application and automatically pulls back the record based on the key parameter. In delete mode, all fields are set to read-only and the user is prompted to confirm deletion of the record.
Copy Mode
DICTIONARY.M00010s?action_mode=copy&CNUM=100001
In copy mode, the specified record’s data is pulled to the form, allowing the user to change all fields including the dimension key and will add the record upon submission.
View Mode
DICTIONARY.M00010s?action_mode=view&CNUM=100001
While in view mode, all fields are read-only and the “Accept” (submit) button is hidden.
One Step Mode
All of the above scenarios have dealt with how to call a maintainer and then allow the user to work with the record in question. However, you may have a need to call the maintainer “in the background” without displaying the on-screen form to the user. You may even pass the new field values to the maintainer in order to add, update or copy the record.
The URL to update a record might look like this:
DICTIONARY.M00010s?action_mode=update&CNUM=12345&CSTATE=NE
To make it automatically carry out the update, include the following parameter to the end of the URL string:
&one_step=1
The whole string now looks like this:
DICTIONARY.M00010s?action_mode=update&CNUM=12345&CSTATE=NE&one_step=1
This instructs the maintainer to execute the update in one single step, without showing the user any screens.
On Screen Redirect
By default, the maintainer will redirect back to itself in add mode after submission regardless of the action mode used. To change this, you can specify a redirect via the Workflow Designer.