USP_DATAFORMTEMPLATE_ADD_EXCHANGECONTACTBATCHROW

The save procedure used by the add dataform template "Exchange Contact Batch Row Add Form".

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.
@BATCHID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@CHANGEDBYAPPUSERID uniqueidentifier IN
@CONSTITUENTID uniqueidentifier IN
@BIOLOGICALINFORMATION xml IN Biological information
@PHONEINFORMATION xml IN Phone information
@HOMEADDRESSINFORMATION xml IN Exchange home address information
@BUSINESSADDRESSINFORMATION xml IN Exchange business address information
@OTHERADDRESSINFORMATION xml IN Exchange other address information
@EMAILADDRESSINFORMATION xml IN Email address information
@SEQUENCE int IN
@CREATENEWBUSINESSADDRESS bit IN Copy existing address information to a new address before updating with the downloaded information
@NEWBUSINESSADDRESSTYPECODEID uniqueidentifier IN New address type
@CREATENEWHOMEADDRESS bit IN Copy existing address information to a new address before updating with the downloaded information
@NEWHOMEADDRESSTYPECODEID uniqueidentifier IN New address type
@CREATENEWOTHERADDRESS bit IN Copy existing address information to a new address before updating with the downloaded information
@NEWOTHERADDRESSTYPECODEID uniqueidentifier IN New address type
@PROCESS bit IN Process
@DONOTMAILBUSINESSADDRESS bit IN Do not mail to new address
@DONOTMAILHOMEADDRESS bit IN Do not mail to new address
@DONOTMAILOTHERADDRESS bit IN Do not mail to new address
@INFOSOURCECODEID uniqueidentifier IN Information source

Definition

Copy


                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_EXCHANGECONTACTBATCHROW
                    (
                        @ID uniqueidentifier output,
                        @CHANGEAGENTID uniqueidentifier,
                        @BATCHID uniqueidentifier,
                        @CHANGEDBYAPPUSERID uniqueidentifier,
                        @CONSTITUENTID uniqueidentifier,
                        @BIOLOGICALINFORMATION xml = null,
                        @PHONEINFORMATION xml = null,
                        @HOMEADDRESSINFORMATION xml = null,
                        @BUSINESSADDRESSINFORMATION xml = null,
                        @OTHERADDRESSINFORMATION xml = null,
                        @EMAILADDRESSINFORMATION xml = null,
                        @SEQUENCE int = null,
                        @CREATENEWBUSINESSADDRESS bit = 0,
                        @NEWBUSINESSADDRESSTYPECODEID uniqueidentifier = null
                        @CREATENEWHOMEADDRESS bit = 0,
                        @NEWHOMEADDRESSTYPECODEID uniqueidentifier = null,
                        @CREATENEWOTHERADDRESS bit = 0,
                        @NEWOTHERADDRESSTYPECODEID uniqueidentifier = null,
                        @PROCESS bit = 1,
                        @DONOTMAILBUSINESSADDRESS bit = 0,
                        @DONOTMAILHOMEADDRESS bit = 0,
                        @DONOTMAILOTHERADDRESS bit = 0,
                        @INFOSOURCECODEID uniqueidentifier = null
                    )
                    as
                        set nocount on;
                        declare @CURRENTDATE datetime;

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

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

                        set @CURRENTDATE = getdate();

                        begin try
                            insert into dbo.EXCHANGECONTACTBATCH
                                (ID, 
                                BATCHID,
                                CHANGEDBYAPPUSERID, 
                                CONSTITUENTID,                                 
                                BIOLOGICALINFORMATION, 
                                PHONEINFORMATION, 
                                HOMEADDRESSINFORMATION, 
                                BUSINESSADDRESSINFORMATION, 
                                OTHERADDRESSINFORMATION, 
                                EMAILADDRESSINFORMATION, 
                                SEQUENCE
                                CREATENEWBUSINESSADDRESS, 
                                NEWBUSINESSADDRESSTYPECODEID, 
                                CREATENEWHOMEADDRESS, 
                                NEWHOMEADDRESSTYPECODEID, 
                                CREATENEWOTHERADDRESS, 
                                NEWOTHERADDRESSTYPECODEID, 
                                PROCESS, 
                                DONOTMAILBUSINESSADDRESS, 
                                DONOTMAILHOMEADDRESS, 
                                DONOTMAILOTHERADDRESS,
                                INFOSOURCECODEID,
                                ADDEDBYID, 
                                CHANGEDBYID, 
                                DATEADDED, 
                                DATECHANGED)
                            values
                                (@ID
                                @BATCHID
                                @CHANGEDBYAPPUSERID
                                @CONSTITUENTID
                                @BIOLOGICALINFORMATION
                                @PHONEINFORMATION
                                @HOMEADDRESSINFORMATION
                                @BUSINESSADDRESSINFORMATION
                                @OTHERADDRESSINFORMATION
                                @EMAILADDRESSINFORMATION
                                @SEQUENCE
                                @CREATENEWBUSINESSADDRESS
                                @NEWBUSINESSADDRESSTYPECODEID
                                @CREATENEWHOMEADDRESS
                                @NEWHOMEADDRESSTYPECODEID
                                @CREATENEWOTHERADDRESS
                                @NEWOTHERADDRESSTYPECODEID
                                @PROCESS
                                @DONOTMAILBUSINESSADDRESS
                                @DONOTMAILHOMEADDRESS
                                @DONOTMAILOTHERADDRESS,
                                @INFOSOURCECODEID,
                                @CHANGEAGENTID
                                @CHANGEAGENTID
                                @CURRENTDATE
                                @CURRENTDATE)
                        end try

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

                        return 0;