USP_DATAFORMTEMPLATE_ADD_GLACCOUNTBATCH

The save procedure used by the add dataform template "Account 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.
@ACCOUNTNUMBER nvarchar(100) IN Account number
@DESCRIPTION nvarchar(100) IN Description
@SEQUENCE int IN Sequence
@ACCOUNTALIAS nvarchar(255) IN Account alias

Definition

Copy

                    CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_GLACCOUNTBATCH
                    (
                        @ID uniqueidentifier = null output,
                        @CHANGEAGENTID uniqueidentifier = null,
                        @BATCHID uniqueidentifier,
                        @ACCOUNTNUMBER nvarchar(100) = '',
                        @DESCRIPTION nvarchar(100) = '',
                        @SEQUENCE integer = 0,
            @ACCOUNTALIAS nvarchar(255) = ''
                    )
                    as

                    set nocount on;

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

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

                    declare @CURRENTDATE datetime
                    set @CURRENTDATE = getdate()

                    begin try
                        -- handle inserting the data
                        insert into dbo.GLACCOUNTBATCH
                            (ID, BATCHID, ACCOUNTNUMBER, ACCOUNTDESCRIPTION, PDACCOUNTSYSTEMID, SEQUENCE, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED, ACCOUNTALIAS)
                        values
                            (@ID, @BATCHID, @ACCOUNTNUMBER, @DESCRIPTION, '4B121C2C-CCE6-440D-894C-EA0DEF80D50B', @SEQUENCE, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE, @ACCOUNTALIAS)

                    end try

                    begin catch
                        exec dbo.USP_RAISE_ERROR
                        return 1
                    end catch

                    return 0