USP_DATAFORMTEMPLATE_VIEW_DESIGNATIONCAMPAIGNSFROMSELECTION

The load procedure used by the view dataform template "Designation Campaigns From Selection"

Parameters

Parameter Parameter Type Mode Description
@ID nvarchar(72) IN The input ID parameter used to load the fields defined on the form.
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.
@SEQUENCE int INOUT SEQUENCE
@DESIGNATIONS xml INOUT DESIGNATIONS
@DATALOADED bit INOUT Output parameter indicating whether or not data was actually loaded.

Definition

Copy


                CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_DESIGNATIONCAMPAIGNSFROMSELECTION
                (
                    @ID nvarchar(72),
                    @CURRENTAPPUSERID uniqueidentifier,
                    @SEQUENCE int = null output,
                    @DESIGNATIONS xml = null output,
                    @DATALOADED bit = 0 output
                ) as begin
                    set nocount on;

                    declare @CAMPAIGNID uniqueidentifier;
                    declare @IDSETREGISTERID uniqueidentifier;
                    set @CAMPAIGNID = substring(@ID,  1, 36);
                    set @IDSETREGISTERID = substring(@ID, 37, 36);

                    select 
                        @SEQUENCE = coalesce(max(DESIGNATIONCAMPAIGN.SEQUENCE), 0),
                        @DESIGNATIONS = dbo.UFN_CAMPAIGN_DESIGNATIONSBYSELECTION_TOITEMLISTXML(@CAMPAIGNID, @IDSETREGISTERID, @CURRENTAPPUSERID),
                        @DATALOADED = 1
                    from
                        dbo.DESIGNATIONCAMPAIGN
                    where 
                        DESIGNATIONCAMPAIGN.CAMPAIGNID = @CAMPAIGNID

                    return 0;

                end