Executes a delete-statement.
Allows you to validate the parameters supplied by the user before any other SQL is run in the component. This call is only made if the component has visible parameters, the SQL is a stored procedure, and Validate parameters is checked.
Stored procedure that is beeing executed instead of standard SQL-delete.
May use SoftadminApi.Progress_SetTitle and SoftadminApi.Progress_SetStep.
Deprecated. Use ADMIN_CancelMenuItem instead.
Id of the menuitem to execute if the user clicks Cancel in an ADMIN_FORCE dialog (the default being none). This value overrides cancelmenuitemid specified in the query string.
Alias of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuGroup instead.
Id of the menu group to show after execution (instead of former menu item). This value overrides any destination specified by the query string.
Deprecated. Use ADMIN_ForwardMenuItem instead.
Id of the menu item to execute after execution (instead of former menu item). This value overrides any destination specified by the query string.
Displays a user friendly error message to the user.
This SQL call may use SoftadminApi.SyncEntity_RaiseChanged.
Use this call to restrict which entries a user is allowed to view and edit, and to log which entries a user views.
Access to a menu item is normally controlled through functions and roles alone but some entities need more fine grained control. For example, a user may have access to the View Member menu item for normal members but not for members with a protected identity.
The menu items a user visits are always logged (in ADMINLogMenuItem) but for sensitive data you may need to log exactly what entries are viewed. Do the logging in this call as the common ways of viewing data (grid and InfoSQL) are not allowed to modify the database.
If you bind a scalar function instead of a stored procedure to this call then its name must end with '_GrantAccess'.
Avoid using nested transactions (since only the outermost matters regarding ROLLBACK or COMMIT). The following code only starts transactions when necessary, ie if one has not already been started. Make sure to look at the @IsUsingLocalTransaction parameter before any COMMITs or ROLLBACKs.
-----------------------
-- Begin transaction --
-----------------------
DECLARE
@IsUsingLocalTransaction bit
IF @@TRANCOUNT = 0
BEGIN
SET XACT_ABORT ON
BEGIN TRANSACTION
SELECT
@IsUsingLocalTransaction = 1
END
--------------------------
-- INSERT/UPDATE/DELETE --
--------------------------
<DML statements>
------------------------
-- Commit transaction --
------------------------
IF @IsUsingLocalTransaction = 1
BEGIN
COMMIT TRANSACTION
END
This code demonstrates how to use the process functions to maintain a progress bar during processing.
CREATE TABLE #ToPostProcess
(
ThingyId int not null
);
/* Choose things to post-process here */
INSERT #ToPostProcess (ThingyId)
SELECT n
FROM SoftadminUtil.Number_Range(1,5);
EXEC SoftadminApi.Progress_SetTitle
@TitleText = 'Post processing thingies';
DECLARE
@CompletedSteps int = 0,
@TotalSteps int = (SELECT COUNT(*) FROM #ToPostProcess);
DECLARE ThingyCursor CURSOR LOCAL FOR
SELECT
ThingyId
FROM
#ToPostProcess;
OPEN ThingyCursor;
WHILE 1=1
BEGIN
EXEC SoftadminApi.Progress_SetStep
@CompletedSteps = @CompletedSteps,
@TotalSteps = @TotalSteps;
DECLARE @ThingyId int;
FETCH ThingyCursor INTO @ThingyId;
IF @@FETCH_STATUS <> 0
BREAK;
/* Post-process Thingy with id @ThingyId here */
-- EXEC Example.Thingy_PostProcess @ThingyId = @ThingyId;
SET @CompletedSteps += 1;
END
CLOSE ThingyCursor;
DEALLOCATE ThingyCursor;
DROP TABLE #ToPostProcess;
The stored procedure should be named "<Schema>.<Table>_Delete".