- Contents
Latitude Help
Create a Custom Panel
Administrators can create a custom panel to display read-only data for an account displayed in the Work Form. An administrator specifies a name for the panel, the data to display, and whether users can view the panel in the Work Form. Administrators can create as many custom panels as necessary.
To create a custom panel
-
Create a stored procedure that takes in the @accountid parameter as an INT and specifies the data to display in the panel. The @accountid parameter is the file number. The following example shows a procedure that pulls data from the lat.Note table:
CREATE PROCEDURE dbo.TestNotes
(
@accountid INT
)
AS
BEGIN
SELECT [UserName], [ActionCode], [ResultCode], [Comment], [DateCreated]
FROM [lat].[Note]
WHERE [AccountId] = @accountid
ORDER BY [DateCreated] DESC
END
GO
-
Insert a row into the lat.UserInterfacePlugins table that specifies the plug-in name, display name (panel name), and Sproc name. Don't change the "type" or "URL" values. See the following example:
INSERT INTO [lat].[UserInterfacePlugins]
( [Type] ,
[PluginName] ,
[DisplayName] ,
[Url] ,
[Parameters]
)
VALUES ( 'PANEL' , -- Type - varchar(25)
'GenericDataPanel' , -- PluginName - varchar(50)
N'Generic Data Grid Panel' , -- DisplayName - nvarchar(100)
N'workform/views/panel/genericPanel.tmpl.html' , -- Url - nvarchar(250)
'dbo.TestNotes' -- Parameters - varchar(255)
)
-
Enable the panel in the Reference Panels permission. When a user with the appropriate permissions opens the panel in the Work Form, Latitude calls the associated procedure, passes the file number, and displays the returned data in the associated panel.