Is it possible to set the URL for a Link Hotspot equal to a [text] field’s value?
What I’d like to do is as follows. I want to include a link hotspot on a document that points to an Internet address. However, I don’t want to hard-code that address. Instead I thought I would create an action using:
FieldValue := @Prompt([OkCancelEdit]; “Document Location”; “Type the URL.”;“”);
and then fill the URL field in the HotSpot Link equal to FieldValue.
FIELD DynamicLink := @Prompt([OkCancelEdit]; “Document Location”; “Type the URL.”;“”);
Create a “Computed for Display Field” and give it the name “DynamicLink”, value also DynamicLink.
Create a Hotspot Link, click on the @ symbol and enter as Formula: DynamicLink
The document using this Form has to be in Edit mode in order to make this work, so make sure you enforce Edit mode in some way, using @Formulas or Form properties.
If you need this to work also in Read mode, you can use environment variables:
Create a button which executes your Formula:
@SetEnvironment(“DynamicLink”;@Prompt([OkCancelEdit]; “Document Location”; “Type the URL.”;“”));
Create a Hotspot Link, click on the @ symbol and enter as Formula: @Environment(“DynamicLink”)
As a side effect (which can be quite nice actually) the last entered link will remain when the Form is opened, and if you don’t want that behaviour, you can clear the “DynamicLink” variable when opening the Form. And if you want the link to be saved in the 1st example too, just create the field as “Computed” type field, then also other users can experience the last used link, in case that adds some value to your application.