Leb i Sol Posted October 28, 2003 Posted October 28, 2003 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!
-Queue- Posted October 28, 2003 Posted October 28, 2003 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
Leb i Sol Posted October 29, 2003 Author Posted October 29, 2003 :-) great! This worked like a dream! Thank you sir!
Leb i Sol Posted October 29, 2003 Author Posted October 29, 2003 one followup question: is there a way to assing a scrip "onSelect/onEntry" of a pop-menu instead of a "validating button" as u suggested? thank you!
Leb i Sol Posted October 29, 2003 Author Posted October 29, 2003 would a "transparent button" over the Entire Body (when clicked outside of portal-run the script) be an "OK solution"?
-Queue- Posted October 29, 2003 Posted October 29, 2003 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.
-Queue- Posted October 29, 2003 Posted October 29, 2003 If you can make anything work for you, then I would say it's definitely "OK".
Recommended Posts
This topic is 7699 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