Creating a POST redirect mass action for list

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
I am trying to create a POST redirect Mass Action button for a list. When I select records in my Skuid page and click the redirect mass action I created I get an error message "You must select at least one ‘In Progress’ document". I have double checked and the records I am choosing are 'In Progress'.


Maybe I am missing something that I need to update in the URL. Has anyone had success in creating a POST mass action list button? 

This is the URL:https://ffbext.cs10.visual.force.com/apex/codabecashentrybulkposting?retURL=%2Fa1q%3Ffcf%3D00BU0000003AnRA%26rolodexIndex%3D-1%26page%3D1&wrapMassAction=1&scontrolCaching=1


Thank you!
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Tami, see these posts. Visualforce interprets URL Parameters as POST data so all you need to do is send the right URL Parameters. If you are trying to pass in a list of Ids then you need to add a separate "ids" parameter for each Id, e.g. "/apex/codacashentrybulkposting?ids=0010000000111&ids=00100000000222" ....

https://community.skuidify.com/skuid/topics/how_to_add_marketo_send_email_mass_action_to_a_skuid_tab...
https://community.skuidify.com/skuid/topics/mass_action_inline_javascript_on_related_list_for_drawlo... 
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
Hi Zach,

Thanks for the quick reply. I followed your instructions and I have a new error. 

"java.lang.IllegalArgumentException: id a1qU0000000KHk3IAGretURL=/a1q?fcf=00BU0000003AnRA&rolodexIndex=-1&page=1 must be 15 characters "

Here is what my in-line snippet looks like:
// Get the Ids of the selected items as an Array
var idsArray = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ 

   return item.row.Id; 

});

// Convert this array to a comma-separated String

var idsString = idsArray.join(',');


// POST to FF

window.top.location = "https://ffbext.cs10.visual.force.com/apex/codabecashentrybulkposting?ids="+ idsString +"
?retURL=%2Fa1q%3Ffcf%3D00BU0000003AnRA%26rolodexIndex%3D-1%26page%3D1&wrapMassAction=1&scontrolCaching=1";
Photo of Tami Lust

Tami Lust

  • 5,280 Points 5k badge 2x thumb
I have this working now. The join for the ids couldn't be ','. I think that is what you were telling me in your original post but I wasn't quite understanding. I would either get the 15 character error or only the first record would be posted. When I changed ',' to '&ids=' I was able to post all selected records.
Below is the final code. 

// Get the Ids of the selected items as an Array
var idsArray = skuid.$.map(arguments[0].list.getSelectedItems(),function(item){ 

   return item.row.Id; 

});

// Convert this array to a comma-separated String

var idsString = idsArray.join('&ids=');


// POST to FF

window.top.location ="https://ffbext.cs10.visual.force.com/apex/codabecashentrybulkposting?ids="+ idsString +"&retURL=%2Fa1q%3Ffcf%3D00BU0000003AnRA%26rolodexIndex%3D-1%26page%3D1&wrapMassAction=1&scontrolCaching=1";