USP_DATAFORMTEMPLATE_ADD_ASSIGNCONSTITSECURITYATTRIBUTESPROCESS_2

The save procedure used by the add dataform template "Assign Constituent Security Attributes Process Add Form 2".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@NAME nvarchar(100) IN Name
@DESCRIPTION nvarchar(255) IN Description
@SCOPEIDSETREGISTERID uniqueidentifier IN Selection of constituents to process
@CONSTIT_SECURITY_ATTRIBUTEID uniqueidentifier IN Group
@ASSIGNTOIDSETREGISTERID uniqueidentifier IN Selection of constituents to assign attribute to
@CREATEOUTPUTIDSET bit IN Create output selection
@OUTPUTIDSETNAME nvarchar(100) IN Selection name
@OVERWRITEOUTPUTIDSET bit IN Overwrite existing selection
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_ASSIGNCONSTITSECURITYATTRIBUTESPROCESS_2
(
    @ID uniqueidentifier = null output,                        
    @CHANGEAGENTID uniqueidentifier = null,    
    @NAME nvarchar(100), 
    @DESCRIPTION nvarchar(255) = null
    @SCOPEIDSETREGISTERID uniqueidentifier = null,
    @CONSTIT_SECURITY_ATTRIBUTEID uniqueidentifier = null,
    @ASSIGNTOIDSETREGISTERID uniqueidentifier,
    @CREATEOUTPUTIDSET bit = 0,
    @OUTPUTIDSETNAME nvarchar(100) = null
    @OVERWRITEOUTPUTIDSET bit = 0,
    @CURRENTAPPUSERID uniqueidentifier
) as
    set nocount on;

    declare @CURRENTDATE datetime;
    set @CURRENTDATE = getdate();

    if @ID is null
            set @ID = NewID();

    if @CHANGEAGENTID is null
        exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;

    begin try
        insert into dbo.ASSIGNCONSTITSECURITYATTRIBUTESPROCESS
        (
            [ID],
            [NAME],
            [DESCRIPTION],
            [SCOPEIDSETREGISTERID],
            [CONSTIT_SECURITY_ATTRIBUTEID],
            [ASSIGNTOIDSETREGISTERID],
            [CREATEOUTPUTIDSET],
            [OUTPUTIDSETNAME],
            [OVERWRITEOUTPUTIDSET],
            [ADDEDBYID],
            [CHANGEDBYID],
            [DATEADDED],
            [DATECHANGED]
        )
        values
        (
            @ID,
            @NAME,
            @DESCRIPTION,
            @SCOPEIDSETREGISTERID,
            @CONSTIT_SECURITY_ATTRIBUTEID,
            @ASSIGNTOIDSETREGISTERID,
            @CREATEOUTPUTIDSET,
            @OUTPUTIDSETNAME,
            @OVERWRITEOUTPUTIDSET,
            @CHANGEAGENTID,
            @CHANGEAGENTID,
            @CURRENTDATE,
            @CURRENTDATE
        );

    exec dbo.USP_BUSINESSPROCESSINSTANCE_ADD @CHANGEAGENTID = @CHANGEAGENTID
                                            @BUSINESSPROCESSCATALOGID = '7787A828-36A0-4E86-B86E-C501E528963C'
                                            @BUSINESSPROCESSPARAMETERSETID = @ID
                                            @OWNERID = @CURRENTAPPUSERID;

    end try
    begin catch
        exec dbo.USP_RAISE_ERROR;
        return 1;
    end catch

    return 0;