g@briellelevenson ha scritto:
My problem: If a container field is missing its referenced file, it gives the "The file cannot be found: file.jpg" data in the container, but that doesn't seem to be mineable data. I need to create a calculation field that outputs "Image Missing" if a referenced container image cannot be found
Try to put this calculation into the auto-enter option for that container field:
List ( Self ; "image:IM.png" )
where IM.png is an image that you has created with the text: Image Missing.
If FileMaker doesn't found the first image, will display the second. ( getting rid of the offending "The file cannot be found: file.jpg" message )
The new Calculation "VerifyContainer ( containerFieldName )" works only with stored container objects which are stored Externally to the data file.
From FileMaker 12 Help: Returns a Boolean value representing the validity of data stored externally in a container field (emphasis added). A 0 (False) value means the data was changed or deleted; otherwise, 1 (True) is returned.
I have not found a non-interactive method of testing that the sources of referenced containers are still available.
As an auto-enter, this will only return the information on the status of the refernced object at the moment it is entered. I don't think this will help in determining if the reference still read the referenced file at a later time.
Stephen Huston ha scritto:
I don't think...
If so, why not give it a try ?
What's going to trigger the auto-enter to refresh?
The presence or the absence of the referenced file at the given path.
Changing the name of a file which is outside of FileMaker (referenced only) will not trigger anything within the file. Auto-enter as a field option requires some kind of trigger event within FileMaker to cause it to recalculate.
Try building a simple file where this works with a "store only reference" container content. Then close the FM file, rename to container source document, and reopen the file to see what the auto-entered field says about any change.
I think that are you who has to try the trick.
Doing what you said returns "Image Missing" to me! ( as expected )
( the double path given by the List ( ) function works much like the multiple path that can have an $path; FileMaker search the first path and, if it cant find it, will search the second path... and so on. Only when no path is good, FM returns an error )
Can you post your file so we can be sure to do exactly what you are doing to get this to work?
Great! I like what you did, and I am pleased to see that work, as far as it goes.
However, the need of our original post-writer was how to "mine" the info shown in the container field to test if the path if valid with info that can be used programmatically -- a result which can be tested. So far, it's just replaced one message in a container field with another message in a container field.
Can you show a way to extract that container field message to use outside the container field? (i.e. in a script for an IF test)
I would love to find a way to do that.