SoftadminGuide.MenuItem_Create

Type: Stored procedure

Creates Softadmin® Menu items.
Expects two temp tables created using SoftadminGuide.MenuItem_Definition and SoftadminGuide.MenuItemFieldTable_Definition.

Example

SELECT * INTO #MenuItem FROM SoftadminGuide.MenuItem_Definition();

DECLARE @MenuItemGuid uniqueidentifier = NEWID();

INSERT INTO #MenuItem
(
    MenuItemGuid,
    Component,
    MenuItemName,
    SystemFunctionBlockId,
    MenuGroupGuid,
    MenuSubgroupGuid,
    ComponentProcedureName,
    HideMenuitem,
    InsertUpdateProcedureName,
    IdParameterName
)
SELECT
	@MenuItemGuid,
	'Delete',
	'Delete car',
	SoftadminGuide.SystemFunctionBlockId_GetFromTableName('MySchema.Car'),
	@MenuGroupGuid, -- An existing menu group
	@MenuSubgroupGuid, -- An existing menu subgroup
	'MySchema.Car_Delete',
	1,
	NULL,
	'CarId';

SELECT * INTO #MenuItemFieldTable FROM SoftadminGuide.MenuItemFieldTable_Definition();

INSERT INTO #MenuItemFieldTable
(
    MenuItemGuid,
    FieldTable
)
VALUES
(
	@MenuItemGuid,
	'MySchema.Car'
);

EXEC SoftadminGuide.MenuItem_Create
	@UserId = @UserId;

Parameters

@UserId mandatory int
The user running the guide.

Resultsets

Resultset: #MenuItem

A temporary table used as input to the procedure. Containing the menu items to create.
Table count: repeated exactly once
Row count: one or more rows
Columns
MenuItemGuid mandatory uniqueidentifier

Identifies the menu item.

Component mandatory string

Component type

Possible value Description
Delete
Edit NewEdit in component mode "Edit".
Grid
New NewEdit in component mode "New".
MenuItemName mandatory string

Name of menu item.

MenuGroupGuid mandatory uniqueidentifier

All menu items must be part of a menu group.

MenuSubgroupGuid optional uniqueidentifier

A menu item may be part of a subgroup.
Has no meaning if HideMenuItem = 1.

ComponentProcedureName optional string

Stored procedure used by the menu item. Usage depends on the component.

HideMenuitem mandatory bit

Set to 0 to list the menu item in the menu group.

InsertUpdateProcedureName optional string

The only guide-supported component that used the InsertUpdate-procedure is NewEdit ('New' and 'Edit').

IdParameterName optional string

Only used by NewEdit and Delete.
Name of the identifying parameter passed to the procedures of the NewEdit and Delete components.

Default: For NewEdit and Delete component: If NULL, the identifying parameter will be named "@Id".

Resultset: #MenuItemFieldTable

A temporary table used as input to the procedure. Containing the field tables to use for the respective menu item.
Table count: repeated zero or one time
Row count: zero or more rows
Columns
MenuItemGuid mandatory uniqueidentifier

The menu item to set field table for.

FieldTable mandatory string

Field table.