- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2015 12:25 PM
I have a query for a GlideDialogWindow and I want to filter it to "opened in the last 90 days". What is the best way to accomplish this?
var customerField = g_form.getValue('aFieldOnTheForm')
dw.setPreference('sysparm_query', 'active=true^requested_for=' + customerField + '^query string here');
I went to Incidents to create my filter and get the encoded query, but I found multiple options to accomplish this task. What do you recommend and why?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 05:48 AM
If you build the filter you are interested in the UI, then right click on the breadcrumbs and copy "Copy query", you can see exactly what the platform is submitting to obtain a given result set. In this case:
opened_atRELATIVEGE@dayofweek@ago@90
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2015 12:37 PM
I think the simplest is "opened_at>=javascript:gs.daysAgoStart(90)". The nice thing about that is you do not have to worry about the time - it looks at the whole day, starting at 00:00:00.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 05:48 AM
If you build the filter you are interested in the UI, then right click on the breadcrumbs and copy "Copy query", you can see exactly what the platform is submitting to obtain a given result set. In this case:
opened_atRELATIVEGE@dayofweek@ago@90
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2015 08:11 AM
This is the route I had taken before I made this post and am happy with the results. Thank you for helping !