Table Row Sort from Wizard to Detail Page

  • 1
  • Question
  • Updated 4 years ago
  • Answered
I created a wizard for users to create a new quote and there is a custom object to add line items within a table. When users are finished and redirected to the skuid detail page, the ordering of the line items in the detail page table is different than what was added in the wizard table.

I attempted to sort on Created Date and the Name (auto number), but Salesforce doesn't seem to save based on the order of creation. Any ideas on a workaround so that the ordering from the wizard will be reflected on the detail page?

Thanks!
Photo of Chelsea Curtis

Chelsea Curtis

  • 1,300 Points 1k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Josh Cutler

Josh Cutler, Official Rep

  • 864 Points 500 badge 2x thumb
Using a Created Date or an 'auto-number' field was a great idea for a solution, but the Salesforce database processes the records asynchronously. This means their saved order won't match the order you entered into the wizard.

A simple (but not elegant) solution would be to create a new field on your custom object (like LineItemOrderNumber). Add the new field to your model as well as the table within the wizard. Then you can enter the order number manually with each line item.

Be sure to check the box next to "Allow Ordering" in the field you created on the detail page.

You could also go with an inline javascript snippet to help auto-number the line items. This was done on the following post: https://community.skuidify.com/skuid/topics/custom_snippet_to_auto_number

Hope we can help you get the solution you are after!

-Josh
Photo of Chelsea Curtis

Chelsea Curtis

  • 1,300 Points 1k badge 2x thumb
Thanks for the info Josh. The link to the javascript snippet post is what I am looking for. Is there a resource for the exact javascript used in that post? I added a comment there with the same question. Thanks.