Modify default query for Sn record picker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:01 AM
Hello Experts,
I want to modify the default query for the below script , i want to add the below mentioned conditions
Condition : if a user is active and name starts with
<sn-record-picker id="delegate" field="c.delegate" table="'sys_user'" default-query="'active=true'" display-field="'name'" display-fields="'email'" value-field="'sys_id'" search-fields="'name'" page-size="100" translate="no"></sn-record-picker>
Right now default query runs checks for if the user is active and 'name contains' instead of name contains i want to check for "name starts" with.
Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 09:15 PM
@aksh3 you can paste encoded query in default-query.
In your case, you can use default-query="'activate=true^nameSTARTWITHyour_text'".
Hope this will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:08 PM
In the Server Side of the Widget:
data.encQuery = 'encoded query';
Then in SN Record Picker call the same as mentioned below:
<sn-record-picker
field :
table:
default-query = 'c.data.encQuery'>
</ sn-record-picker>