Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7249 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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??

Posted

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?:)

Posted

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.

This topic is 7249 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.