Creates Softadmin® Menu items.
Expects a temp table created using SoftadminGuide.MenuItem_Definition and two optional temp tables created using SoftadminGuide.MenuItemProcedureParameter_Definition and/or SoftadminGuide.MenuItemFieldTable_Definition.
SELECT * INTO #MenuItem FROM SoftadminGuide.MenuItem_Definition();
DECLARE @MenuItemGuid uniqueidentifier = NEWID();
INSERT INTO #MenuItem
(
MenuItemGuid,
Component,
MenuItemName,
MenuGroupGuid,
MenuSubgroupGuid,
ComponentProcedureName,
HideMenuItem,
ConfirmationText,
IdParameterName
)
SELECT
@MenuItemGuid,
'Delete',
'Delete car',
@MenuGroupGuid, -- An existing menu group
@MenuSubgroupGuid, -- An existing menu subgroup
'MySchema.Car_Delete',
1,
'Are you sure you want to delete the car?',
'CarId';
SELECT * INTO #MenuItemProcedureParameter FROM SoftadminGuide.MenuItemProcedureParameter_Definition();
INSERT INTO #MenuItemProcedureParameter
(
MenuItemGuid,
Part,
ProcedureParameterName,
SessionVariable
)
VALUES
(
@MenuItemGuid,
'Component',
'UserId',
'UserId'
);
SELECT * INTO #MenuItemFieldTable FROM SoftadminGuide.MenuItemFieldTable_Definition();
INSERT INTO #MenuItemFieldTable
(
MenuItemGuid,
FieldTable
)
VALUES
(
@MenuItemGuid,
'MySchema.Car'
);
EXEC SoftadminGuide.MenuItem_Create
@UserId = @UserId;
Identifies the menu item.
Component type
Possible value | Description |
---|---|
Delete | |
Detailview |
Detail view with or without tabs (component mode TabView or InfoView). Dynamic tabs not supported. |
Edit | NewEdit in component mode "Edit". |
Grid | |
New | NewEdit in component mode "New". |
Name of menu item.
All menu items must be part of a menu group.
A menu item may be part of a subgroup.
Has no meaning if HideMenuItem = 1.
Stored procedure used by the menu item. Usage depends on the component.
Set to 0 to list the menu item in the menu group.
The only guide-supported component that used the InsertUpdate-procedure is NewEdit ('New' and 'Edit').
Only used by NewEdit and Delete.
Name of the identifying parameter passed to the procedures of the NewEdit and Delete components.
The menu item to set procedure parameters for.
Determines which procedure the parameters should be attached to.
Possible value | Description |
---|---|
Component | |
InfoSql | |
InsertUpdate |
Name of the parameter to the SQL procedure.
Name of a passing field used as value.
A static bit used as value.
Name of a system setting used as value.
Session variable used as value. Refer to Admin -> "Session variables" for possible values.
Special value used as value. Special information from the platform.
Possible value | Description |
---|---|
Client IP | The IP address that the user is currently accessing the system from. Not defined when there is no user, for example because the menu item is executing as a job. |
Current menu item ID | The ID of the current menu item. |
Is popup | If the current menu item is in a popup. |
Parent menu item SQL | The SQL that was executed on the previous visible menu item. |
The menu item to set field table for.
Field table.