USP_DATAFORMTEMPLATE_EDITLOAD_BATCHWORKFLOWSTATE2

The load procedure used by the edit dataform template "Batch Workflow State Edit Form 2"

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter used to load the fields defined on the form.
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.
@NAME nvarchar(200) INOUT Name
@ALLOWCOMMIT bit INOUT Allow batch to be committed when in this state
@ISINITIALSTATE bit INOUT This is the initial state for the workflow
@ALLOWEDIT bit INOUT Allow batch to be edited in this state
@OVERDUEIN tinyint INOUT Days before batch is overdue
@PERMISSIONS xml INOUT
@TSLONG bigint INOUT Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record.

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_BATCHWORKFLOWSTATE2
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @NAME nvarchar(200) = null output,
    @ALLOWCOMMIT bit = null output,
    @ISINITIALSTATE bit = null output,    
    @ALLOWEDIT bit = null output,
    @OVERDUEIN tinyint = null output,
    @PERMISSIONS xml = null output,
    @TSLONG bigint = 0 output
)
as
set nocount on;

set @DATALOADED = 0
set @TSLONG = 0

select
    @DATALOADED = 1,
    @NAME = NAME,
    @ALLOWCOMMIT=ALLOWCOMMIT,
    @ISINITIALSTATE=ISINITIALSTATE,
    @ALLOWEDIT = ALLOWEDIT,
    @OVERDUEIN = coalesce(OVERDUEIN,0),
    @PERMISSIONS = dbo.UFN_BATCHWORKFLOWSTATE_GETSYSTEMROLEPERMISSIONS_TOITEMLISTXML(@ID),
    @TSLONG = TSLONG
from dbo.BATCHWORKFLOWSTATE 
where ID = @ID;

return 0;