auto populate and make the field read only depending upon the assignment group on incident form

Yash38
Kilo Guru

if assignment group is service desk then Business service field should be read only and populate as IT service, for other assignment group that field should be editable and empty.

(create a field Business service on incident form)

1 ACCEPTED SOLUTION

Create an Onchange Client script on incident table

Field Name - Assignment Group

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        g_form.setReadOnly('business_service', false);
    }
    if (newValue == "d625dccec0a8016700a222a0f7900d06") {
        g_form.setValue('business_service', '281a4d5fc0a8000b00e4ba489a83eedc');
        g_form.setReadOnly('business_service', true);
    } else {
        g_form.setValue('business_service', '');
        g_form.setReadOnly('business_service', false);
    }

  }

Please mark my answer correct and helpful if this resolves your issue.

Regards,

Palak

View solution in original post

7 REPLIES 7

Palak Gupta
Tera Guru
Tera Guru

Hi there!

You can write an onchange client script for this. If you have already written any script please share the same.

Regards,

Palak

No, i haven't written any script

Create an Onchange Client script on incident table

Field Name - Assignment Group

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        g_form.setReadOnly('business_service', false);
    }
    if (newValue == "d625dccec0a8016700a222a0f7900d06") {
        g_form.setValue('business_service', '281a4d5fc0a8000b00e4ba489a83eedc');
        g_form.setReadOnly('business_service', true);
    } else {
        g_form.setValue('business_service', '');
        g_form.setReadOnly('business_service', false);
    }

  }

Please mark my answer correct and helpful if this resolves your issue.

Regards,

Palak

Thanks Palak for your help, The script is working as per our expectations.