Skip Navigation LinksALVAO 10.0ALVAO 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\ folder under the ALVAO WebApp installation folder. The Approval_Template.cshtml and Approval_Template.cs files are provided as templates.

Creating a new form

Copy the form template – the Approval_Template.cshtml file to the Custom\<company name>folder and the Approval_Template.cs file to the Custom\<company name>\Code folder. Rename both files to reflect the function 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 first part of the file code includes the area that can be edited. This area is marked with code 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;

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.