3 Replies Latest reply on Nov 5, 2019 6:43 PM by Mr Peabody-Oracle

    SetLink DAL Function Not Working?

    Ken Waters

      Hi All,


      We are trying to create a dynamic URL using SetLink. It's described function is "Use this function to update a hyperlink setting in a variable field, a graphic, or a text label.".

      Our target object is a graphic which we set as an external link. We created a hidden field at the end of the field list to call a DAL to construct our url and call SetLink to update the object reference. Unfortunately we are unable to get the object to reference any link. We have tried adding a Param even though it is option (target=new). We have also tried pre-setting the HREF of the graphic link itself. (This results in that link displaying only).


      Here it our call to SetLink

      url = http://www.website.com



      The expectation is the HREF value of the graphic update to url.

        • 1. Re: SetLink DAL Function Not Working?

          Some thoughts. Change the last parameter from "Graphic" to "Logo". Also, you can check to see if SetLink returns 1 for Success or 0 for Failure. If it fails, I'd suggest using the HaveLogo DAL function to see if your Logo exists.

          • 2. Re: SetLink DAL Function Not Working?

            One last thing, the object (variable field, graphic, or text label) referenced by SetLink must have an initial hyperlink setting so make sure you Logo has an initial hyperlink set on it.

            • 3. Re: SetLink DAL Function Not Working?
              Mr Peabody-Oracle

              As Sherman said, the type parameter is "FIELD", "LOGO", or "TEXT" despite the fact that the help says "graphic". That needs to be corrected - either in the doc or in the code.

              My second thought is that your call may not be specific enough to find the graphic in question. You appear to be omitting the section, form, and group (line of business) parameters. Therefore, depending upon where this script is executed, it may only look at the 'current' section and not look any further. So if you are calling the script from an associated field on the same section, that's fine. Or if this is a section DAL rule and that is the section where the graphic is, then you may be okay. However, if this is executing at some global scripting - or from a location not otherwise known to be on the same section with the graphic, you may need to provide more parameters. Worse case is you can tell it to look anywhere in the form set by providing an asterisk as the parameter to the group name. Not the most efficient method, but certainly will scan everywhere.