- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 12:05 AM
Dear community experts,
I want to update this field values to 60 days and update the error message accordingly , how do I achieve it.
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 02:18 AM
Hi @Jaydeee
To change the Exception Duration from 12 to 6 months, you can look into the Exception Management Configuration [sn_vul_exception_config].
Now, you can config the Duration Validation for a specific table.
And to custom the Error Message, you can check the line 476 > the function getErrorMessageInvalidUntilDate().
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 12:13 AM
Hi you need to call the Client callable Script include:
Client callable Script Include:
var MyDateTimeAjax = Class.create();
MyDateTimeAjax.prototype = Object.extendsObject(AbstractAjaxProcessor, {
calDate: function () {
var sdt = new GlideDateTime(this.getParameter('sysparm_date'));
sdt.addDaysLocalTime(60);
return sdt.getDate();
},
type: 'MyDateTimeAjax'
});
Client SCript :
Client Script:
var gr = new GlideAjax('MyDateTimeAjax');
gr.addParam('sysparm_name', 'calDate');
gr.addParam('sysparm_date', g_form.getValue('u_date')); //Please update the field name
gr.getXML(ajaxResponse);
function ajaxResponse(serverResponse) {
var answer = serverResponse.responseXML.documentElement.getAttribute("answer");
alert(answer);
g_form.setValue('field_name', answer);
}
This will automatically set the date to 60 days from now, what is the criteria for the error?
If the date is less than 60 days you can check via SI and return true and false and get the error from CS
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 12:14 AM
Hi @Jaydeee
Inside the UI Action Request Exception, you will see it's opening a dialog with the endpoint named "sn_vul_review_request".
You can find it in the UI Page table, or you can use the URL below.
URL: https://<instance_name>/sys_ui_page.do?sys_id=a9f62f0aff3302007a6dffffffffff9e
From the line 65, you should see the date field element.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 02:18 AM
Hi @Jaydeee
To change the Exception Duration from 12 to 6 months, you can look into the Exception Management Configuration [sn_vul_exception_config].
Now, you can config the Duration Validation for a specific table.
And to custom the Error Message, you can check the line 476 > the function getErrorMessageInvalidUntilDate().
Cheers,
Tai Vu