Creating 400 + records in table with poor performance

  • 1
  • Problem
  • Updated 1 year ago
I've got a use case where I have an application that logically creates data based on the users input and attribute on products and bill of material. I use a snippet to cycle rough the data and then insert into a model and save. The volume can be 400-600 records and is at times an issue for Firefox and IE..user getting "browser non responsive...do you want to continue". So I'm looking for ideas on a better options. I was thinking about trying to pass to apex and avoid the browser save
Photo of Eric Tuggle

Eric Tuggle

  • 342 Points 250 badge 2x thumb

Posted 1 year ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Seems like server side would be better.
Photo of Jayesh Bhatnagar

Jayesh Bhatnagar

  • 476 Points 250 badge 2x thumb
Trying to better understand the comment above. Will just moving the save from the skuid page to an apex class perform better? I would still have to figure out how to pass the records from the skuid page to the apex class. Or was the suggestion that all 400 loop processing and save be moved to the apex class?
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I just think that the solution you've to built to save 400+ records in Skuid is unlikely to be without issues.

Salesforce isn't able to accommodate saving so many records in one operation from a user. So, you could setup your snippet to save in smaller batches of records, but then you'd be opening up the solution to other issues. What would happen if the internet connection was lost of the browser crashed in the middle of saving some records. You'd a partially saved set of records. How would you recover from that?

This is why it would be best to build this solution server side. Process and Flow? Apex? Dunno
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Eric,

This seems like a good use for @invocable Apex.  You can have your user select the parameters and pass them into the invocable call through the Action Framework.  With 400+ records to create, you want Salesforce to handle this.

Thanks,

Bill