Make variables read only after group approval stage (RITM)

rafaelalves4337
Tera Contributor

Hello folks,

 

I have created a Script include and Client script to make 2 variables editable after user submit, so the approval team can make changes and assign a better group team to work, it's all working fine so far, the problem now is, those variables still editable even after the approval stage is Approved, I have tried some variations here but still not finding a solution, below is the client script I'm using, could you please help me this situation?

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   
    var number = g_form.getValue('number');
    var ga = new GlideAjax('XXXXXXXX');
    ga.addParam('sysparm_name', 'fetchDataweb');
    ga.addParam('sysparm_name_number', number);

    ga.getXML(callback);

    function callback(response) {
        var answer = response.responseXML.documentElement.getAttribute('answer');
        if (answer == 'Client XXXX') {
			
			g_form.setReadOnly('target_date', false);
			g_form.setReadOnly('all_assin_group',false);

			g_form.setMandatory('all_assin_group', true);
}

 

6 REPLIES 6

Approvals are separate records. If Assignment Group is mandatory, it should be filled out before the approval is sent. There's not a clean way to require an approval to fill out an Assignment group on a separate record before approving.

yuvarajkate
Giga Guru

Add Conditions here, or go with UI Policy that would be a more simpler way to deal with this problem.