- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 06:12 AM
Hi All,
I am creating a referenced field by using <sn-record-picker> directive in service portal. And, it will default to some value
Now, i want to make this field readonly. Is there any way to disable editing of this field?
Regards
Swamy
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 06:31 AM
You can use
sn-disabled="c.data.variable_name"
Here is an example
<sn-record-picker sn-disabled="c.data.hasRole" field="c.requestedFor" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 06:46 AM
This is the only information i was able to find
Attributes in sn-record-picker
scope: {
field: '=', // The field object, like all other form elements have.
table: '=', // The table to search.
defaultQuery: '=?', // A base query that provides further result filtering. Like a reference qualifier.
searchFields: '=?', // Comma separated fields to search
valueField: '=?', // Field to use for field.value. Default is sys_id.
displayField: '=?', // Field to use for field.displayValue. Default is determined by getDisplayValue
displayFields: '=?', // Additional fields to show in result row.
pageSize: '=?',
onChange: '&',
snDisabled: '=',
multiple: '=?',
options: '=?',
placeholder: '@'
}
Source: sn-record-picker directive · Issue #59 · service-portal/documentation · GitHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2024 12:18 AM
Please use this
<sn-record-picker sn-disabled="fieldName" field="c.requestedFor" table="'sys_user'" display-field="'name'" value-field="'sys_id'" search-fields="'name'" page-size="100" ></sn-record-picker>
Here "fieldName" refers to the value of attribute "field".