Last time out we were adding some data verification checks to a template form in ManageEngine ServiceDesk Plus to check on the length, and hence value, of a numerical data input field for employee ID numbers. As mentioned this client also had a requirement to check on a date entry field for the delivery of a service and advise the user if the requested delivery date was realistic. Using Field and Form Rules on a Service Request template this is quite easy to achieve. In this example the client had created a custom field on their service template, represented by the internal field name of ServiceReq_601_UDF_DATE1 (see note below). Now all we needed to create was a logic rule to test for date validity when a user entered any data into this date field. An example of the script code used is given below and is was designed to present the user with a pop-up alert message in the event that the requested date for delivery was less than 7 days from today’s date:
var req_start_date=$CS.getValue("ServiceReq_601_UDF_DATE1");
var min_del_date = new Date();
/* Calculate minimum delivery date (Today plus 7 days) */
min_del_date.setDate(min_del_date.getDate() + 7);
if(req_start_date < min_del_date)
{
alert("Please note that New User Requests can take up to 7 days to complete. Please contact support directly to facilitate this request or select an alternative start date greater than 7 days from today.");
$CS.stopFormSubmission(); /*stop form submission*/
}
These articles have only scratched the surface of what is potentially possible using Field & Form Rules. We suggest you start experimenting and please feel free to share your ideas.
Enjoy!
Note: If you’re unsure of the internal field name of a custom field simply go to the ‘Field & Form’ tab of the relevant template and create a logic rule. If you select an ‘Action’ of ‘Execute Script’ in the pop-up editor you can look for the Template Field label name you used to create the field. The editor will then indicate the internal label it is using for this custom field and the default operations you can perform on this field. Check out Part 1 for a screenshot .. ;0)
This article is relevant to:
Service DeskOther recent articles in the same category
You may be interested in these other recent articles
Third Party Integration with ServiceDesk Plus: A Standardised Approach
5 February 2025
In today’s fast-paced IT landscape, businesses rely on third-party application integrations to streamline workflows and enhance operational efficiency. To unlock the full potential of these…
Read moreExport Contracts in ServiceDesk Plus: A Practical Solution
30 January 2025
Find out how customers who need to export contracts from ServiceDesk Plus come to Set3 Solutions for expert guidance.
Read moreLatest Updates for ManageEngine Endpoint Central
27 January 2025
Discover the latest Endpoint Central updates, including new features, fixes, and enhancements.
Read moreStay Ahead with the Latest Updates for ManageEngine OpManager
22 January 2025
Discover the latest OpManager updates, including new features, fixes, and enhancements.
Read moreLatest Updates for ManageEngine ServiceDesk Plus Cloud
18 January 2025
Discover the latest ServiceDesk Plus Cloud updates, including new features, fixes, and enhancements.
Read more