What is the $sp.getListColumns default view?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 05:03 AM
If I run this script
var fields = new GlideSPScriptable().getListColumns('incident',null);
gs.info(fields);
It prints "number,category,short_description,priority".
Where is this list of fields coming from?
I thought it might be coming from the Incident list configuration for the "Portal" view (sys_ui_list). The OOB list of fields is number, category, short_description, priority. But after I changed the list, the function still returned the original.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2024 05:11 AM - edited 05-15-2024 05:11 AM
that function returns fields in a view. but passing null returned same results to me. but below script returned list of fields in default list view.
var fields = new GlideSPScriptable().getListColumns('incident','default');
gs.info(fields);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2024 07:58 PM - edited 10-30-2024 08:00 PM
FYI. the getListColumns() returns the default columns as you may know.
Default columns can be configured via 2 steps:
- Open your list > Cog menu > click 'Reset to column defaults' button
- Then on the list again > click 3-dot on one of the columns > Configure > List layout
I hope that fixes your issue.