requesting help for below script for a custom table.

sony8
Tera Contributor

I am working on the below script:

this is my UI policies script:

 

function onCondition() {

    var DDMissedSLA = new GlideAjax("UTBRequestClientUtils");
    DDMissedSLA.addParam("sysparm_name", "ValidateDependency");
    DDMissedSLA.addParam("sysparm_recordid", g_form.getUniqueValue());
    DDMissedSLA.getXML(ValidateDependency);
}

function ValidateDependency(response) {
    var answer = response.responseXML.documentElement.getAttribute("answer");
    alert("get si value " + answer);
    if (answer == 'true') {
        alert("Less than or equal to 12 / 18 months");
        g_form.clearValue('u_dependency');
        g_form.setMandatory('u_dependency', false);
        g_form.setVisible('u_dependency', false);

    } else {
        alert("test greater than 12 and 18 months");
        g_form.setVisible('u_dependency', true);
        g_form.setMandatory('u_dependency', true);

    }
}

 

 

 

my scriptInclude:

 

my script ios not executing as expected always going to false, my dates are not validating as expected. Please help me below lines:

The below dates are not outputing as expected.

reqCreatedDatePlus12Months

reqCreatedDatePlus18Months

the below line was conflicting my code but not understanding how to replicate other than below line:

reqCreatedDate.addMonthsLocalTime(-12);

 

Please help me ......

1 REPLY 1

Kieran Anson
Kilo Patron

Hey looks like you've missed off your script include - if you can add it 🙂