Newbies Sooner Shadow Posted May 19, 2011 Newbies Posted May 19, 2011 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!
LaRetta Posted May 19, 2011 Posted May 19, 2011 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.
Newbies Sooner Shadow Posted May 19, 2011 Author Newbies Posted May 19, 2011 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.
Recommended Posts
This topic is 4937 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now