Skip Navigation LinksALVAO 10.1ALVAO Service DeskSystem Implementation in an OrganizationCustom Edits and ExtensionsCustom Request Approval Form Skip Navigation Links. Skip Navigation Links Skip Navigation Links.


Custom Request Approval Form

The system form for request approval/rejection in ALVAO WebApp can be replaced with a custom form having a specific content and behavior. The custom form enables the approver to set some request items, thus enabling the support of more complex approval schemes.

Templates for creating custom forms are located in the \Custom\Templates\Approval folder under the ALVAO WebApp installation folder.

Creating a new form

Copy the form template – the Approval folder – to the Custom\<functionality name> folder. Rename the .cshtml and .cs files contained in the folder so that their names correspond to the meaning or the functionality of the form.

Note:
A general description of the settings of custom forms is available in the Custom New Request Form instructions.

Form Behavior Definition

The form behavior is defined in the .cs file. The editable sections of the code are marked with comments. Do not alter any other parts of the code! The approval of requests is the most important feature. The file already includes an example of request approval and rejection that you can use to create your own versions.
The basic structure of request approval/rejection commands is as follows:

TicketApprovalAccept(iHdTicketId, "The request has been approved:"+ MessageBody);
TicketApprovalReject(iHdTicketId, "The request has been rejected:"+ MessageBody);

Where MessageBody is the default request approval/rejection text that has been created through the conversion of the form data to text. If required, you can concatenate the texts in all items as shown in the example. If you want to insert a line break, use the \n tag.

Note:

If the "StringField" element, into which you can enter text in HTML format, is used in the form, use the "<br>" string for line break.
Use the following structure for access to the custom items values (example for items "NewName" and "NewNumber"):

string newName = ((ColumnsControl)Model.ColumnsControl["ColumnsControl0"]).Values.Find(Col => Col.Column.sColumn == "NewName").Value as string;
int newNumber = (int)((ColumnsControl)Model.ColumnsControl["ColumnsControl0"]).Values.Find(Col => Col.Column.sColumn == "NewNumber").Value;
Note:

If you want to approve the current step, skip any following steps of the approval scheme, and prematurely terminate the approval process, use the following structure:

TicketApprovalAcceptAndFinish(iHdTicketId, "The request has been approved:"+ MessageBody);

Connecting the Form to Application

Double-click on ALVAO Admin – Approving – Approval schemes to open a window for editing the approval step. Enter the URL of the newly created form (in the same format as is used in Service – Service Catalog) into the Custom form (URL) item.

 

Did not find what you were looking for? Ask our technical support team.