1 of 1 people found this helpful
Something in your script (or perhaps a calculation field) has to trigger a change to the value of either the merge field or perhaps instead a global variable. The 'problem' will be in the refreshing of the layout to reflect the change.
Obviously the state of having data in the container field or not is the decider...
Would something like this work?
Case ( IsEmpty ( Image_Data ) ; "Insert" ;
not IsEmpty ( Image_Data ) ; "Delete" )
I would use:
If ( IsEmpty ( Image_Data ) ; "Insert" ; "Delete" )
You don't have to code for both empty or not empty because one can act as the default.
You could also use Boolean values if only 2 options are available, i.e. insert or delete in your case.
Set your merge field to be a number 0 or 1, then format your field in the inspector on the data tab ( select Boolean as the format then change the Yes / no, true / false values to insert / delete. I don’t believe this encounters the refresh issues Lyndsay mentioned. Of course, your script will need to modified to use 0 or 1 as the control logic values.
Both good methods.
Tim's might seem odd and more complex at first glance but there are lots of advantages to using Boolean values including being able to use a summary field to give you a total of the number of records which do have images.
Thanks guys..good points all round..