Looking for assistance on populating a FMP16 layout showing a contact database, with a photo of the particular person. There are hundreds of records in the database. I am attempting to adapt the following sample code for this script that is purported to put the picture up on the dashboard and create an error log for pictures it cannot find. It'd be great if I could get it to work.
Go To Record/Request [first]
Set Variable [ $path ; Get(DocumentPath) & "/products/" & products::productCode & ".jpg" ]
Insert Picture [ products::image ; $path ]
if [ get(lasterror) <> 0 ]
Set Variable [ $log ; List ( $log ; products::productCode & ".jpg is missing from folder" ) ]
Go To Record/Request [next ; exit after last ]
Set Field [ products::log ; $log ]
Set Variable [ $logpath ; Get(DesktopPath) & "log.txt" ]
Export Field Contents [ products::log ; $logpath ]
I am sure the problem I am having with this script is setting up the path variable.
The path to the folder that contains the photo files is called "Photos" and it is at:
In may main table I calculate the file name, which is comprised of the first and last names of the contacts (for example, the photo for John Doe is the file "Doe_John_.68.jpg" which is located in the /Photos/ subfolder).
I just need to work out how the phot is accessed and displayed on the layout.
Anyone have good advice on this?