USP_DATAFORMTEMPLATE_EDIT_PROSPECTFUNDINGINTEREST_2
The save procedure used by the edit dataform template "Prospect Funding Interest 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. |
@FUNDINGTYPECODEID | uniqueidentifier | IN | Funding type |
@INTERESTLEVELCODE | tinyint | IN | Level of interest |
@COMMENT | nvarchar(max) | IN | Comments |
@SITES | xml | IN | Sites |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_PROSPECTFUNDINGINTEREST_2 (
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@FUNDINGTYPECODEID uniqueidentifier,
@INTERESTLEVELCODE tinyint,
@COMMENT nvarchar(max),
@SITES xml
) as
set nocount on;
declare @CURRENTDATE datetime = getdate();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
begin try
update dbo.PROSPECTFUNDINGINTEREST set
FUNDINGTYPECODEID = @FUNDINGTYPECODEID,
INTERESTLEVELCODE = @INTERESTLEVELCODE,
COMMENT = @COMMENT,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE
where
ID = @ID
-- update sites
exec dbo.USP_PROSPECTFUNDINGINTEREST_GETSITES_UPDATEFROMXML @ID, @SITES, @CHANGEAGENTID;
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;