What is the $sp.getListColumns default view?

Giles Lewis
Giga Guru

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.

2 REPLIES 2

Gangadhar Ravi
Giga Sage
Giga Sage

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);

 

 

alexaria
Tera Contributor

@Giles Lewis 

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.