Ctask planned start date and end date value error message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 02:48 AM
HI All
I have requirement in change module. There are two fields in change request and CTASK table. Planned start date and Planned end date. So the requirment is whenever any Ctask created the value planned start date and Planned end date time should be copied from change request form , For this I have written two onLoad client script and two script include. Issue is whenever I am opening opening a new Ctask or existing Ctask all the time it is showing a warning message "Task end date should be in the change window. Values are populating. Can some one please help me where my script is going wrong or what should I do to correct script so that it will work fine. Below is the code.
Thanks in advanced
Script include: populatesupportGroup3
var populatesupportGroup3 = Class.create();
populatesupportGroup3.prototype = Object.extendsObject(AbstractAjaxProcessor, {
groupPopulation: function(){
var sysID = this.getParameter('sysparm_cr_sysid');
var crGrp = new GlideRecord('change_request');
crGrp.get(sysID);
return crGrp.end_date;
},
type: 'populatesupportGroup3'
});
Client script: Copy Planned end date from Chg request
function onLoad() {
//Type appropriate comment here, and begin script below
var group = new GlideAjax('populatesupportGroup3');
group.addParam('sysparm_name', 'groupPopulation');
group.addParam('sysparm_cr_sysid', g_form.getValue('change_request'));
group.getXML(result);
function result(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('planned_end_date', answer);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 11:16 AM
Script?
Just update the Subflow: Change - Implementation tasks - and add your 2 fields to each of the CTasks created.
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-03-2023 08:46 PM
Hi Prasnajeet,
I checked your script in my PD instance and it is working as expected and not getting any validation message for me.
I believe in your instance, some validation script is written, and it is causing an issue.
- Thanks
- Kailas