OnRecordLoad will be triggered each time a new record becomes current. but if your container field does not have global storage and is not from a related table linked with the X operator, you should not see this image in every record of the found set and thus no scripting is needed.
The OnRecordLoad worked like a charm, thank you. Not sure how I missed it in the first place, probably should call it a day soon ;-)
But this does present a new problem. I use the Clear step to clear the field, but this leave the field selected. So the user has to click somewhere in the layout before he can scroll on. I tried 'Set Selection' without specifying anything, but I guess that was a stretch anyway.
How I can tell Filemaker to not have any fields selected?
Set Field [ YourTable::Field ; "" ]
will clear the field without putting the focus in the field. But I will repeat that this should not be necessary if you don't use a global field for this purpose.
That worked like a charm. Thank you!
It is a global field. Used to be a calculation, but that wont let me change the field via scripts, and only calculations have the 'don't store' option. Seemed to me to be my only option when I need to set the field via scripts and want to keep storage as low as possible (when I can't tell it to not store the field at all).
If your container fields have external storage specified or you use "store a reference" when inserting the image, the image file is not stored in your file at all and that should address your storage concerns. Then a container field that does not have global storage specified might be used and when the user scrolls to a different record, you won't see the same image in this field.
But please note that I know very little about your database so global storage may remain the better option. It just seems like you want a field with global storage to act as though it doesn't have global storage specified...
Thanks for your continued insights Phil :-)
You're right, I really don't want that field stored at all - but at the same time I want to be able to set the field via a script (which calculation type field does not allow).
I tried looking around for a 'store a reference' setting, but couldn't find anything like that. What / where are you referring to?
I have not once suggested that this be a field of type calculation. It can be a plain, simple container field with standard storage options. "store a reference" is an option that you select when inserting or importing the image into the container field in the first place. External storage is an option that became available for container fields with the release of FileMaker 12.