C
|
Chris Whitehead 5/14/2025 |
There's 2 ways you can do this. First option is run a select query in the before add event to check if the record exists, the return false if a record exists. Or add a unique index in the database, this is the best option as PHPRunner should handle the error when trying to add a duplicate record and you don't have to keep track of the code if you add more views. |
G
|
GMO author 5/16/2025 |
Thank you Chris I did the Unique index option you suggested. Mysql stops or phpr stops the INSERT EVENT for new record. But does not provide message as to what happened. |
C
|
Chris Whitehead 5/16/2025 |
I expected PHPRunner to display a message stating why the record wasn't added as there's no failed event handler for the add events. Maybe this could be added in a future version. If you need a message then you'll need to check if the record exists in the before record added event using the "Check if specific record exists" |
G
|
GMO author 6/4/2025 |
I found a solution in this forumand help manuals. The below script verifies there is no existing address, home phone, cell phones when adding "New Client". It works for me, but could be much better. It should pop open a message box, open the existing record @ View Page, Yes? or No? // =============================================================Begin // Script begins // ============================================================== begin // ============================================================== begin // ============================================================== begin |