USP_DATAFORMTEMPLATE_EDIT_EXCHANGECONTACTBATCHROW_2

The save procedure used by the edit dataform template "Exchange Contact Batch Row Edit Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier IN The input ID parameter indicating the ID of the record being edited.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@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_EDIT_EXCHANGECONTACTBATCHROW_2
                    (
                        @ID uniqueidentifier,
                        @CHANGEAGENTID uniqueidentifier,
                        @CHANGEDBYAPPUSERID uniqueidentifier,
                        @CONSTITUENTID uniqueidentifier,
                        @BIOLOGICALINFORMATION xml,
                        @PHONEINFORMATION xml,
                        @HOMEADDRESSINFORMATION xml,
                        @BUSINESSADDRESSINFORMATION xml,
                        @OTHERADDRESSINFORMATION xml,
                        @EMAILADDRESSINFORMATION xml,
                        @SEQUENCE int,
                        @CREATENEWBUSINESSADDRESS bit,
                        @NEWBUSINESSADDRESSTYPECODEID uniqueidentifier, 
                        @CREATENEWHOMEADDRESS bit,
                        @NEWHOMEADDRESSTYPECODEID uniqueidentifier,
                        @CREATENEWOTHERADDRESS bit,
                        @NEWOTHERADDRESSTYPECODEID uniqueidentifier,
                        @PROCESS bit,
                        @DONOTMAILBUSINESSADDRESS bit,
                        @DONOTMAILHOMEADDRESS bit,
                        @DONOTMAILOTHERADDRESS bit,
                        @INFOSOURCECODEID uniqueidentifier
                    )
                    as
                        set nocount on;

                        declare @CURRENTDATE datetime                                        

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

                        set @CURRENTDATE = getdate()

                        begin try
                            update
                                dbo.EXCHANGECONTACTBATCH
                            set
                                CHANGEDBYAPPUSERID = @CHANGEDBYAPPUSERID,
                                CONSTITUENTID = @CONSTITUENTID,
                                BIOLOGICALINFORMATION = @BIOLOGICALINFORMATION,
                                PHONEINFORMATION = @PHONEINFORMATION,
                                HOMEADDRESSINFORMATION = @HOMEADDRESSINFORMATION,
                                BUSINESSADDRESSINFORMATION = @BUSINESSADDRESSINFORMATION,
                                OTHERADDRESSINFORMATION = @OTHERADDRESSINFORMATION,
                                EMAILADDRESSINFORMATION = @EMAILADDRESSINFORMATION,
                                SEQUENCE = @SEQUENCE,
                                CREATENEWBUSINESSADDRESS = @CREATENEWBUSINESSADDRESS,
                                NEWBUSINESSADDRESSTYPECODEID = @NEWBUSINESSADDRESSTYPECODEID,
                                CREATENEWHOMEADDRESS = @CREATENEWHOMEADDRESS,
                                NEWHOMEADDRESSTYPECODEID = @NEWHOMEADDRESSTYPECODEID,
                                CREATENEWOTHERADDRESS = @CREATENEWOTHERADDRESS,
                                NEWOTHERADDRESSTYPECODEID = @NEWOTHERADDRESSTYPECODEID,
                                PROCESS = @PROCESS,
                                DONOTMAILBUSINESSADDRESS = @DONOTMAILBUSINESSADDRESS,
                                DONOTMAILHOMEADDRESS = @DONOTMAILHOMEADDRESS,
                                DONOTMAILOTHERADDRESS = @DONOTMAILOTHERADDRESS,
                                INFOSOURCECODEID = @INFOSOURCECODEID,
                                CHANGEDBYID = @CHANGEAGENTID,
                                DATECHANGED = @CURRENTDATE
                            where
                                EXCHANGECONTACTBATCH.ID = @ID;                    
                        end try

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

                        return 0;