2

Here is my scenario:

  1. Entering some values on the forms.

enter image description here

  1. On clicking Create, I want to check if the same data exists on the table.

  2. If exists, I want to popup the message as this value is already exists with Yes/No option.

  3. If the user clicking on Yes, then I wanted to Proceed the transaction which means I wanted to submit a page.

  4. If user selected No, then I wanted to STOP the transaction means I don't want to submit a page.

Please advise the solution to achieve the same.

chrisis
  • 1,983
  • 5
  • 20
  • 17
Vijayan Kumar
  • 21
  • 1
  • 4
  • Why did you tag two different versions of APEX (which are you using)? You could create a Dynamic Action that responds to the click of the Create button. This could use JavaScript code and Ajax to do the validation and respond accordingly. As Scott said, you'll still need to enforce everything at the database level. – Dan McGhan Apr 13 '20 at 18:46

1 Answers1

1

This is the incorrect way for thinking about web technologies.

There's a significant time difference between 3 + 4, enough for another transaction to have occurred.

You should be applying constraints to the table, and responding to a key violation. At best, a warning could be present onChange of your item. But this should be re-validated on page submit.

Scott
  • 4,857
  • 3
  • 22
  • 33
  • Thanks for your response Scott. I'm using this logic for one of the business logic. I'm not described entire business logic here. However, I wanted to achieve similar to the question that was mentioned. let me know, if you aware any solution based on the above scenario? – Vijayan Kumar Apr 09 '20 at 10:46