SoftadminGuide.Link_Create

Type: Stored procedure

Creates Softadmin® Links.
Expects two temp tables created using SoftadminGuide.Link_Definition and SoftadminGuide.LinkPassingField_Definition.

Example

DECLARE @DeleteCarLinkGuid uniqueidentifier = NEWID();

SELECT * INTO #Link FROM SoftadminGuide.Link_Definition();

INSERT INTO #Link
(
	LinkGuid,
	MenuItemGuidFrom,
	MenuItemGuidTo,
	LinkType,
	LinkAlias,
	ShowOnlyInNavigator
)
VALUES
(
	@DeleteCarLinkGuid,
	@ListCars,	-- An existing menu item
	@EditCar,	-- An existing menu item
	'RowLink',
	NULL,
	0
)

SELECT * INTO #LinkPassingField FROM SoftadminGuide.LinkPassingField_Definition();

INSERT INTO #LinkPassingField
(
	LinkGuid,
	PassingFieldName,
	PassingFieldType,
	PassingFieldValue
)
VALUES
(
	@DeleteCarLinkGuid,
	'CarId',
	'Column value',
	'CarId'
);

EXEC SoftadminGuide.Link_Create @UserId = @UserId;

Parameters

@UserId mandatory int
The user running the guide.

Resultsets

Resultset: #Link

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

Identifies a link.

MenuItemGuidFrom mandatory uniqueidentifier

The menu item where the link is shown.

MenuItemGuidTo mandatory uniqueidentifier

The link destination.

LinkType mandatory string

Type of link.

Possible value Description
Row link Row link in a grid.
Top link
LinkAlias optional string

Use only if the link is supposed to be referenced by alias.

ShowOnlyInNavigator optional bit

For row links - show the link only in the navigator popup.

Resultset: #LinkPassingField

A temporary table used as input to the procedure. Containing the passing fields for the respective link.
Table count: repeated zero or one time
Row count: zero or more rows
Columns
Id mandatory int

Set by IDENTITY-property. Must be unique even if the temp-table itself has no primary key constraint.

LinkGuid mandatory uniqueidentifier

Identifies link to apply passing field to.

PassingFieldName mandatory string

Name of passing field.

PassingFieldType mandatory string

Supported values:

  • 'Passing field'
  • 'Column value'
  • 'Parameter field'
  • 'Session variable'
  • 'Constant value'
  • 'SelectedItems'
PassingFieldValue optional string

Value to pass. Can be name of column, parameter field, session variable et cetera depending on passing field type.