How to disable a field using sn-record-picker?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2019 02:31 AM
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2019 11:19 PM
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