A: Direct Links - URLs and Downloads

Scott Waldron Updated by Scott Waldron

A Dino command record can be marked as a link. This command should be connected to a command function that takes no arguments and returns a string that will be interpreted as a link. When this type of command is initially interpreted, the function will run immediately to get the link text, then embed that URL directly into the hyperlink of the menu item. These links will always be created with the HTML target attribute set to _blank, so that they will open in a new tab or window.

Link commands are very simple. The URL may be created by any means inside the function. For example, the first two command functions here achieve the same thing, the first by simply spelling out the URL, the second by finding the document in the system and creating the URL.

/**
Command function showing direct link.
*/
def cmdLinkToFile() {
return '/uploads/_shared/2019-11/23/zvlp5od/DINO.pdf?version=4';
}

/**
Command function showing direct link by creating URL from document record.
*/
def cmdLinkToDocumentRecord() {
from Trestle.Files import WebFileExtensions;
from Trestle.Data.SysAdmin import GlobalDocument;

return GlobalDocument.GetRepository().Find('2226').GetAbsoluteUrl();
}

/**
Command function linking to external resource.
*/
def cmdLinkToExternalResource() {
return 'www.amazon.com';
}

How did we do?

A: Files

A: Running SQL Queries

Contact