Ctask planned start date and end date value error message

Prasnajeet1
Giga Guru

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);
}

}

2 REPLIES 2

Michael Fry1
Kilo Patron

Script?

 

Just update the Subflow: Change - Implementation tasks - and add your 2 fields to each of the CTasks created.

Screenshot 2023-05-03 at 2.14.18 PM.png

 

KB18
Tera Guru
Tera Guru

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.

 

KB18_0-1683171969331.png

 

 

KB18_1-1683171969348.png

 

 

- Thanks

Please hit the thumb Icon and mark as correct in case I help you with your query!!!
- Kailas