Textbox with Redirect

Used to help users avoid creating duplicate entries for a given entity, for example two members with the same personal identity number.

The control, resembling a standard textbox, triggers its stored procedure when the user changes its value. This procedure can display a prompt, giving the user the option to navigate to another menu item.

Start value:
Return value:
Supported in: NewEdit


alt text
The textbox with redirect in it's initial state.

alt text
If the user enters a value that is deemed a duplicate, then you can display a forward message (if you want), and then the user will be redirected to another page. Presumably, in this case, a page showing the customer that the user entered.

alt text
You can also display an error message without redirecting, if entering a duplicate value is considered invalid.


SQL Call: Redirect (mandatory)

Called when the textbox's value is changed by the user.

May modify database: No


@Value string
The value in the textbox.

Resultset: Forwarding (optional)

Table count: repeated zero or one time
Row count: exactly one row
<xxx> optional string
Any column with no other specific meaning will pe passed on to the menuitem you are forwarding to.
ADMIN_Message optional string
If present and non-null, displays an error message to the user instead of redirecting.
CancelButtonText optional string
Changes the text of the Cancel button.
ForwardMenuItem optional string
Alias of the menu item to forward to.
ForwardMenuItemId optional int
Deprecated. Use ForwardMenuItem instaed.

Menu item to forward to.
OkButtonText optional string
Changes the text of the OK button.
Prompt mandatory string
Message to show the user before forwarding.


Prevent duplicate personal identity numbers

	@Value varchar(max) = NULL
	DECLARE @PersonId int = (SELECT PersonId FROM Person WHERE PIN = @Value);

	IF @PersonId IS NULL
		RETURN; -- Not a duplicate.

			'A person with PIN ',
			' is already registered. Do you want to view the existing entry?'
			) AS Prompt,
		'View' AS OkButtonText,
		123 AS ForwardMenuItemId,
		-- Passingfields.
		@PersonId AS PersonId;