In the Incident form make the contact type field editable only for Assignment group members. Need the solution for this requirement.

PTR
Tera Expert

hi,

In the Incident form make the contact type field editable only for Assignment group members. Need the solution for this requirement.

1 ACCEPTED SOLUTION

Hi,

you are opening new form but group is not yet filled; so ACL won't work

Unless group is present how can you test your requirement

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

12 REPLIES 12

Musab Rasheed
Tera Sage
Tera Sage

Hi @Thirupathi ,

Though you can do this from ACL but it might create conflict due to lot of other ACLs on incident table hence would be better to follow Display BR and Onload client script like below.

Step 1: Create a display Business rule with script as. Place the below script between function templates in script body.

g_scratchpad.grp = gs.getUser().isMemberOf(current.assignment_group.getDisplayValue());

Step 2 : Write onload script like this.

function onLoad() {

  if (!g_scratchpad.grp){ 

g_form.setReadOnly('contatct_type', true);
}

}

Don't forgot to mark my answer as correct if that helps.

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hi,

Thanks for the reply. As per your answer, I tried in PDI but contact type field is setting  read for Assignment group members as well as other members also who is not part of Assignment group. I.e Contact type filed changes to read mode for every member

But my requirement is quite opposite here i.e contact type field is editable only for AG members who are belongs that group.

Thanks

Hello @Thirupathi ,

Add this in display BR.

g_scratchpad.grp = gs.getUser().isMemberOf(current.assignment_group.toString());

Onload Client script

function onLoad() {

  if (!g_scratchpad.grp){ 

g_form.setReadOnly('contatct_type', true);
}

}

 

Please hit like and mark my response as correct if that helps
Regards,
Musab

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use field level WRITE ACL on Contact type field

Use Script

Advanced - True

Script:

answer = gs.getUser().isMemberOf(current.assignment_group.toString());

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader