Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Limit edit button on reference list to not show up for incident

samadam
Kilo Sage

I am trying add a condition to not show edit button when the reference is from incident. I tried to use parent.sys_class_name='incident' in the Omit Edit condition. Doesn't seem to be working. Any ideas on how to access the parent type?

6 REPLIES 6

Akash4
Kilo Sage

Hello, may be once give a try with Conditional script like: parent.sys_class_name=='incident' 

Alternatively you can also try this:

 

var parentTable =  g_form.getReference('parent', function(parentRecord) {
if (parentRecord.sys_class_name == 'incident') {
  return true;
  }
return false;
}

 

 

Regards, Akash
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.

Tried it but no luck. Also tried

RP.isRelatedList()&&parent.sys_class_name=='incident'

@samadam Try to see if you can adjust condition in ui action for Edit..below is ui action.

 

/sys_ui_action.do?sys_id=f954408f53460110843addeeff7b12dc

 

Please mark my answer correct and helpful if this works for you.

 

 

Neeraj_27
Tera Guru

Hey @samadam ,

I have tried this on child incident related list on incident table and its working for me

NeerajMadishet_0-1729730847065.png

NeerajMadishet_1-1729730862498.png