how to set due date 2 hours from current date/time using client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 10:27 PM
Hi All,
I have a requirement, based on the type selection I need to auto populate due date 2 hours from current date/time using client script How to do it please any one help me.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 09:13 PM
so what script did you use? please share that
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 10:46 PM
var AutoFill = Class.create();
AutoFill.prototype = {
initialize: function() {},
taskType: function() {
var type = this.getParameter('sysparm_type');
var myQuery = "u_type=" + type;
var myCode = new GlideRecord("sn_customerservice_task");
myCode.addEncodedQuery(myQuery);
myCode.query();
if (myCode.next()) {
return true;
} else {
return false;
}
},
type: 'AutoFill'
};
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:25 PM
why are you using Ajax here? you are just returning true/false from script include and not using the answer variable as well in your callback method
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2023 07:46 PM
any update to this thread?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 04:06 AM
This code is not correct you have mixed two things in here and you are using old code which i share with you.