October 23, 200817 yr 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, 200817 yr by Guest
October 23, 200817 yr 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
October 24, 200817 yr Author Thank you, Vaughan ! And, bccoony, there was an error in my post. I am working with FM 8.5 and 9.
Create an account or sign in to comment