USP_DATAFORMTEMPLATE_ADD_DONORCHALLENGEENCUMBERBUSINESS
The save procedure used by the add dataform template "Update Donor Challenge Business Process 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. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@NAME | nvarchar(100) | IN | Name |
@SELECTIONID | uniqueidentifier | IN | Selection |
@SITEID | uniqueidentifier | IN | Site |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_DONORCHALLENGEENCUMBERBUSINESS
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@CURRENTAPPUSERID uniqueidentifier,
@NAME nvarchar(100) = '',
@SELECTIONID uniqueidentifier = null,
@SITEID uniqueidentifier = null
)
as
begin
set nocount on;
declare @CURRENTDATE datetime = getdate();
if @ID is null
set @ID = newid();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
begin try
if (@SITEID is not null)
begin
if dbo.UFN_SITEALLOWEDFORUSER(@CURRENTAPPUSERID, @SITEID) = 0
begin
raiserror ('BBERR_SITE_NOACCESS',13,1);
return 1;
end
end
insert into dbo.DONORCHALLENGEENCUMBERPROCESS
(
ID,
NAME,
SELECTIONID,
ADDEDBYID,
CHANGEDBYID,
DATEADDED,
DATECHANGED
)
values
(
@ID,
@NAME,
@SELECTIONID,
@CHANGEAGENTID,
@CHANGEAGENTID,
@CURRENTDATE,
@CURRENTDATE
)
exec dbo.USP_BUSINESSPROCESSINSTANCE_ADD @CHANGEAGENTID = @CHANGEAGENTID,
@BUSINESSPROCESSCATALOGID = 'f4877be6-6bee-447c-b620-bc90b3996651',
@BUSINESSPROCESSPARAMETERSETID = @ID,
@OWNERID = @CURRENTAPPUSERID,
@SITEID = @SITEID;
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0
end