How to disable a field using sn-record-picker?

Katerina Petrov
Kilo Explorer

Hello!

I am currently working on a form where I need to disable the approver field when a requester is a manager. I already used sn-disabled but it's not working for me.

<sn-record-picker field="approverField" sn-disabled="c.data.manager" table="'sys_user'" display-field="'user_name'" display-fields="'email'" value-field="'sys_id'" search-fields="'user_name'" default-query="'active=true^user_name!=NULL^name!=NULL^u_jobdescription=Manager'"></sn-record-picker>

 

What am i missing here? 

1 REPLY 1

SatheeshKumar
Kilo Sage

sn-disabled="c.data.variable_name"

 

This should work, may be you are missing something in server side while setting variable name.

 

Can you share your server code??

 

Check below link for more info:

 https://community.servicenow.com/community?id=community_question&sys_id=aa120fe9db98dbc01dcaf3231f9619ca&view_source=searchResult

 

Also

sn-disabled="true"

Try to replace this to test the issue is in your html part or from the variable you are passing.

 

-satheesh