May 19, 201114 yr Newbies I have a button that, when clicked, it finds a record based on the contents of the "names" field. If that record exists, it goes to that record and the script ends there. If that record does not exist, I would like it to then create a new record. I would like this all to be done with the one click of the button. I am an extreme novice and any help would be greatly appreciated. Thank you!
May 19, 201114 yr You can try this: Enter Find Mode [pause ] Set Variable [ $name; Value:table::clientName ] Set Error Capture [ On ] Perform Find [ ] If [ not Get ( FoundCount ) ] New Record/Request Set Field [ table::clientName; $name ] End If This allows the User to perform a regular find on the name, stores that request into a variable, performs the find and, if it can't find that name, creates a new record. I would suggest asking the User to verify if they want a new record. I would also caution that if something is misspelled, you can get same customer added twice. It might work better to include something truly unique about them, such as phone number.
May 19, 201114 yr Author Newbies I'll give it a try. Thanks. You can try this: Enter Find Mode [pause ] Set Variable [ $name; Value:table::clientName ] Set Error Capture [ On ] Perform Find [ ] If [ not Get ( FoundCount ) ] New Record/Request Set Field [ table::clientName; $name ] End If This allows the User to perform a regular find on the name, stores that request into a variable, performs the find and, if it can't find that name, creates a new record. I would suggest asking the User to verify if they want a new record. I would also caution that if something is misspelled, you can get same customer added twice. It might work better to include something truly unique about them, such as phone number.
Create an account or sign in to comment