January 20, 200521 yr Hi, I've set up a script for a user to add another record (unique) in a related db. What I want to amend the script to do is throw up a message if the field is not unique. I'm trying to use the Get(Last Error) = 11 but i suspect this is SQL only??? I know I could script a search and if result = 1 run it, but was wondering if there was an easier (shorter) way to script it??
January 21, 200521 yr Author It's just a standard text field. I think I'm doing it the wrong way around, before I create the record I should test if the global value already exists in the table??? I have the field validated to be unique. Show Custom Dialog [Enter New Industry; gInput] Go To Layout Industry Create New Record Set Field Industry; gInput Commit Records (this is where I really need it to say if(Get (Last Error) = 11 show dialog "error record already exists" and roll it back?:)
January 21, 200521 yr Before I create the record I should test if the global value already exists in the table? Yes! It's much easier this way. Just create a relationship between gInput and Industry. Then after the Show Custom Dialog step, add If [isEmpty(relationship::Industry)] before creating a new record. If the test is true, there is no related Industry. If it's false, one already exists.
January 21, 200521 yr Author thanks! I'll re-write when I get back to work after the long weekend.. ahhhh such is life with salary payments
Create an account or sign in to comment