Downloads a file from the database.
The file can be downloaded to the user's computer.
SQL to retrieve the file from the database.
Component wants to know where to forward to, if forwarding is set to "Forward dynamically".
Deprecated. Use ADMIN_CancelMenuItem instead.
Id of the menuitem to execute if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
Alias of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuGroup instead.
Id of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuItem instead.
Id of the menu item to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
Displays a user friendly error message to the user.
Allows you to validate the parameters supplied by the user before any other SQL is run in the component. This call is only made if the component has visible parameters, the SQL is a stored procedure, and Validate parameters is checked.
Use this call to restrict which entries a user is allowed to view and edit, and to log which entries a user views.
Access to a menu item is normally controlled through functions and roles alone but some entities need more fine grained control. For example, a user may have access to the View Member menu item for normal members but not for members with a protected identity.
The menu items a user visits are always logged (in ADMINLogMenuItem) but for sensitive data you may need to log exactly what entries are viewed. Do the logging in this call as the common ways of viewing data (grid and InfoSQL) are not allowed to modify the database.
If you bind a scalar function instead of a stored procedure to this call then its name must end with '_GrantAccess'.
ALTER PROCEDURE Util.Template_Download
@Id int
AS
BEGIN
SELECT
T.Document,
T.DocumentContentType,
T.DocumentFilename
FROM
Util.Template T
WHERE
T.DocumentId = @Id;
END
Let downloadfile deal with text encodings instead of casting varchar to varbinary in the database.
DECLARE @JsonData nvarchar(MAX) = (
SELECT
LogDatetime,
LoginResult,
IsSuccessfulLogin,
Username,
IpAddress
FROM
SoftadminApi.LoginLog
FOR JSON AUTO);
SELECT
'LoginReport.json' AS FileName,
@JsonData AS TextContent,
'utf-8' AS TextEncoding,
'application/json' AS ContentType;