How to apply 'default-query' for Reference Field in Service Portal widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 04:01 AM
Hi,
I am working custom widget. Can anybody tell how to apply 'default-query' for Reference Field in HR portal.
For reference field i am using following
<sn-record-picker field="placement" id="placement" table="'xxxxx'" display-field="'u_title'" value-field="'sys_id'" default-query="" search-fields="'u_title'" page-size="10" ></sn-record-picker>
I have tried in different ways but i am not understanding how to apply default-query to the reference field. Now i am populating all records but I want to query with some restrictions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 04:47 AM
I tried using it as:
default-query="'name=Java Developer'"
and this worked. observe that this are single inverted commas after double.
Let me know if this helps and mark helpful/correct accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2017 09:00 AM
It's just an encoded query. Go to the list view of that table and generate your query using filters, then right click on the filters and select "Copy query" and paste that in the directive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2017 05:08 AM
Thank you Anurag and Nathan for response.
Nathan,
As u suggested I have taken encoded query from list view and it is working fine.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2018 05:00 AM
I am trying to use the query "active=true^NQactive=false^nameSTARTSWITHA". However ^NQ is not working. Can you please provide an alternative to the above query.