If you store your image in a global container field, you can access it from any table.
So your calc with container result would simply be: Case ( not IsEmpty ( Amazon_link ); gAmazonIcon )
Thanks a ton for the help. I have now gotten it to show the Amazon icon if there is a URL available but I would like to be able to click on that icon and open a browser window to go to the URL. In going through the help documentation, it appears I would want to combine the help provided below with the Open URL script. I have tried to stick it in a few different spots and can't seem to get it working. Could anyone please advise? I'm putting more detail below so that should someone else come across this discussion, they could hopefully leverage the solution.
Here are the pertinent fields:
field > contents
amazon_icon > icon image
amazon_purchase_link > the URL to the amazon page
amazon_purchase_indicator > this is where I put the calculation provided below in which it shows the amazon icon if the amazon_purchase_link is populated
Here's the formula with the result set to container:
amazon_purchase_indicator = Case (IsEmpty (amazon_purchase_link);"";amazon_icon)
My question is where to put the Open URL script so that clicking on the amazon_icon would open a browser window and take them to the URL?
Thanks so much.
The calculation where the icon displays. You can make that calc with container result be a button itself.
If [ not IsEmpty (amazon_purchase_link) ]
Open URL [ amazon_purchase_link ]
I apologize if I'm being unusually dense. I think I have the below working as suggested but the button appears even when there is nothing populated in the amazon_purchase_link field.
My goal is that the button (or clickable icon) only appears if there is something populated in the amazon_purchase_link field. Essentially, the script would be that 'If amazon_purchase_link is populated, then display amazon_icon AND if the user clicks on the amazon icon THEN Open URL [amazon_purchase_link]. Otherwise (i.e,. if amazon_purchase_link is blank) then don't do anything and nothing should appear on the layout.
Any help is appreciated.
Thanks a lot.
I dont know what to tell you. I think you have enough from what I have posted to achieve what you are looking for. I would carefully re-read through the posts and try again.
Thanks for the help. I have gotten it to work and will provide some details below for anyone else who might come across this in searching. mr_vodka was exactly correct (obviously) and my mistake was in not recognizing that this is two distinct steps. I was trying to type the Open URL script into the IF portion of the script.
1. Create the field (Type: Calculation; Calculation Result is: Container) with the calculation being
amazon_availability_indicator = If ( not IsEmpty (amazon_purchase_link);amazon_icon)
2. Go to layout and in edit mode, insert the field created in Step 1. Right click and go to Button Set-up. In that dialog box is where you set the script to Open URL and specify the field containing the URL, in this case amazon_purchase_link.
Unchecking 'Change to hand cursor over button' helps, as well.
Thanks for the help.