Jaume Posted October 23, 2008 Posted October 23, 2008 (edited) Hello, I have a database with a text field non-unique. I would have a script that, when entering something in that field, test if there is already another record with that field value. If YES, go to the most recent record; if NOT, create a new record with the field filled with the value not found. I have try to write a script with the Find mode and the Get(FoundCount) but I am unable to succeed.¿Can anybody help me? Thank you Edited October 23, 2008 by Guest
Vaughan Posted October 23, 2008 Posted October 23, 2008 I'd start by doing the entry into a global field. Set up a relationship to a self-join based on this global field and the "real" field to test for the existence of matching records (this is better than a find). Records that do match can then be "selected" using the Go to related Records script step. The script would be something like this: If [ not isempty( selfjoin::field ) ] #matching records Go to Related records [ selfjoin ] Go to Record/request [ last ] Else #no records match New Record Set Field [ field ; gField ] End If
Jaume Posted October 24, 2008 Author Posted October 24, 2008 Thank you, Vaughan ! And, bccoony, there was an error in my post. I am working with FM 8.5 and 9.
Recommended Posts
This topic is 5877 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