Make assignment group field read only on the incident form after saving in SOW

suryaogeti1
Tera Contributor

Once we select the assignment group and after saving the record in the incident form, the field needs to become read only in the service operations workspace, we can't change the assignment group. the below code is not giving the expected output. please help with this

 

function onLoad() {

 

    if (g_form.isNewRecord()) {
        g_form.setReadOnly('assignment_group', false);
        return;
    }

 

   
    var assignmentGroup = g_form.getValue('assignment_group');

 

    if (assignmentGroup) {
        
        g_form.setReadOnly('assignment_group', true);
    } else {
        g_form.setReadOnly('assignment_group', false);
    }

 

 
    g_form.setReadOnly('assigned_to', false);
}
9 REPLIES 9

Hi @Tanushree Maiti 
there is no workspace button in the Ui policy, I can't find it

Sachin_Nasa
Tera Guru

Hi @suryaogeti1 ,

I think you may have missed some part of the explanation, as this approach actually works as per your expectation. Let me attach the screenshot for your reference.
Sachin_Nasa_0-1776688719159.pngSachin_Nasa_1-1776688732813.png

If you found this helpful, please mark it as Helpful and Accept as Solution so it can reach others too.

 

Thanks & Regards,
Sachin Narayanasamy

When we select the value, it is changing to read only, but after saving the record, the assignment group field is getting back to normal, have you tried saving the above record.

Even if you save the record it will be working fine. 

If you wish to connect with me and resolve the issue which you are facing at the earlist please contact me at +91 8903019036 at anytime as you wish.

Thanks!

Thanks & Regards,
Sachin Narayanasamy

Sachin_Nasa
Tera Guru

@suryaogeti1 , Please let me know if you still face any issues

Thanks & Regards,
Sachin Narayanasamy