Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Order by sys_created_on

Vikram3
Tera Guru

Hello All,

I have provided below attribute in a reference field but sorting is not happening. 

I need to sort sys_created_on

ref_auto_completer=AJAXTableCompleter,ref_ac_columns=short_description;requested_by;sys_created_on,ref_ac_columns_search=true,ref_ac_order_by=sys_created_on
1 ACCEPTED SOLUTION

rad2
Mega Sage

Hello,

I have tried with these same attributes and it seems to sort in ascending order of sys_created_by.

If you want it by descending order then you might have to write a query Business Rule.

It is explained in detail in this thread - https://community.servicenow.com/community?id=community_question&sys_id=23bec761dbdcdbc01dcaf3231f9619bf

Business Rule would look something like

(function executeRule(current, previous /*null when async*/) {
	current.orderByDesc("sys_created_on");
})(current, previous);

Hope this helps!

View solution in original post

1 REPLY 1

rad2
Mega Sage

Hello,

I have tried with these same attributes and it seems to sort in ascending order of sys_created_by.

If you want it by descending order then you might have to write a query Business Rule.

It is explained in detail in this thread - https://community.servicenow.com/community?id=community_question&sys_id=23bec761dbdcdbc01dcaf3231f9619bf

Business Rule would look something like

(function executeRule(current, previous /*null when async*/) {
	current.orderByDesc("sys_created_on");
})(current, previous);

Hope this helps!