Jaume Posted October 23, 2008 Share 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 Link to comment Share on other sites More sharing options...
bcooney Posted October 23, 2008 Share Posted October 23, 2008 FM6? Link to comment Share on other sites More sharing options...
Vaughan Posted October 23, 2008 Share 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 Link to comment Share on other sites More sharing options...
Jaume Posted October 24, 2008 Author Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5803 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