Move selected item to top of queue

I am attempting to have ti so that when you click on an item in a queue it moves to the top of the queue.  I have created a checkbox on my object called Pinned (pinned__c) and have the following queue item actions:

  • Show Message and Block UI
  • Update a Field on Row (Pinned__c=TRUE)
  • Save Model Changes
  • Query Model
  • Unblock UI
  • Run Snippet (the snippet performs Update Page Include)
The model is sorted by Pinned__c.  The box will show as checked on the Page Include, but not on the queue (so the selected item in queue doesn’t go to the top).

The sequence of action should be - 
Update a field value  (pinned_c = true)
Requery model
If your model has order by pinned asc/dsc, this should move selected item to top.

Vivek,

Curtis will get an error if he attempts to query after updating. You can’t query a model with unsaved changes.

Curtis,

Try running a one-line snippet like this right after your query action:

skuid.$C(‘MyQueueComponentId’).render();

Replace MyQueueComponentId with whatever the Unique ID of your queue component is.

Does that work?

Hi Curtis

I used the Account Object as a test.  I added a a checkbox field to the object.

I created a Skuid page with the Accounts Model in it and added ‘Pinned__c DESC’ in the ‘fields to order records by’ model properties.

In the Queue properties ‘Item Action’ I set the ‘Item On-Click Action Type’ to multiple actions.

On the ‘Actions’ property I added:

FIRST ACTION
Action Type = Update a field on row(s)
Model = ‘MyModel’ (in my case AccountMod1)
Field = Pinned__c
Value = √

SECOND ACTION
Action Type = 
Save Model Changes
Model to Save = AccountMod1

THIRD ACTION
Action Type = Query Model
Model = AccountMod1
Query Behaviour = Standard-Completely Replace Data

This brings all the pinned models to the top.

That worked, thanks

Very welcome.

Happy Skuiding!