Jump to content

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

Recommended Posts

Hello people!

a push in the right direction would be great!

scenario:

3 fields

[Contact_ID] [Company_ID] [LockRecord]

I am trying to validate user input and "lock" it down based on the fact that there can only be one combination of Contact_ID and Company_ID

I have tried to mark the record by:

LockRecord= If( ((Contact_ID) and (Company_ID))>1,1,0)

but no luck...basically I would like to allow 1 Contact per 1 Company.

These records are entered through the portal so I need to stop the entry as the list might be large and scrolling through all the recors (to make sure that "Contact was not already assigned to the same Company") would be a pain....

Thank you very much!

Link to comment
Share on other sites

Hi Leb, I would create a calculated concatenation of the two ID fields, a self-relationship to itself, and script the entry so that when a record is committed, a button is pushed that validates based on a script with

If [Count(selfrel::serial) > 1]

[color:"white"]__Show Message ["This combination of Company and Contact already exists. Please select another."]

Else

[color:"white"]__Perform Script ["whatever"]

End If

Link to comment
Share on other sites

If you loop, pausing for one second each time, and exit loop if the selection field isn't empty, then yes. But this can get tricky, depending on the OS. Someone could probably point you to a sample file that incorporates options for both Mac and Windows.

Link to comment
Share on other sites

This topic is 7574 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.