How can we generate unique Id without making any DB calls i.e directly from SAIL form

Certified Senior Developer

Hi ,

 

I have a scenario, where I have 2 buttons on my form: Add and Submit.

1) A user has to add details(say for example employee details) before submitting the form.

2)Use can add more than 1 employee details. Once these details are added they are displayed in a new grid in the same form.

3) Once the user clicks on Add button , the details get displayed in new grid, but at the same time I need to generate unique Id for each new addition. 

I will remain on the same form until and unless I submit it. Before submitting the form I need t generate unique Ids(say employee Id).

How this can be done from SAIL side. I do not want DB calls, as this might impact the performance?

 

 

  Discussion posts and replies are publicly visible

Parents
  • I'm not sure how this will impact the performance?

    The best option is to save the employee details using the start process when the user clicks the 'Add' button. You can configure it to start a process that saves the employee to the database and returns the auto-generated primary key to the SAIL form.

    You can also utilize a constant, but just be aware that it will not always be sequential if you run into race conditions. You can use the constant by running the 'increment constant' smart service node and saving that value as your unique id.
Reply
  • I'm not sure how this will impact the performance?

    The best option is to save the employee details using the start process when the user clicks the 'Add' button. You can configure it to start a process that saves the employee to the database and returns the auto-generated primary key to the SAIL form.

    You can also utilize a constant, but just be aware that it will not always be sequential if you run into race conditions. You can use the constant by running the 'increment constant' smart service node and saving that value as your unique id.
Children
No Data