The Zurich release has arrived! Interested in new features and functionalities? Click here for more

order field

Shir Sharvit
Tera Contributor

Hi,

How do I determine for a record in the table, that the value in the order field will always be the smallest

(that is, it will always be displayed last)

10 REPLIES 10

Anil Lande
Kilo Patron

Hi,

You can put the -ve order on the record that you want to display last. On other records you can keep on adding +ve values.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

I need only the record that I need to be last to have an order, I have many more records in the table, how do I put an order for them automatically so that they will be the first

You can use default value configuration on Order to set any value as default. This will work for new records. If you have not created field yet then use default value while creating field.

But for other records you may need to run background script to set order value.

Simply use below script:

var myGr = new GlideRecord('table_name');
myGr.query();
myGr.setValue('u_order', 10);
myGr.setWorkflow(false);
myGr.autoSysFields(false);
myGr.updateMultiple();

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Will it only work on new records?