USP_DATAFORMTEMPLATE_ADD_ACTION_ITEM_PETITION
The save procedure used by the add dataform template "Action Item Petition 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. |
| @ACTIONITEMID | uniqueidentifier | IN | Actionitem |
| @GOAL | int | IN | Goal |
| @PETITIONCOUNT | int | IN | Petitioncount |
| @MINCOUNT | int | IN | Mincount |
| @STARTCOUNT | int | IN | Startcount |
| @SIGNATUREDISPLAY | bit | IN | Signaturedisplay |
| @HIDEADVOCATEMESSAGE | bit | IN | Hideadvocatemessage |
| @THERMOMETERDISPLAY | bit | IN | Thermometerdisplay |
| @COUNTDISPLAY | bit | IN | Countdisplay |
| @THERMOMETERTYPECODE | tinyint | IN | Thermometertype |
| @THERMOMETERPOSITIONCODE | tinyint | IN | Thermometerposition |
| @INCLUDEPETITIONCOUNT | bit | IN | Includepetitioncount |
| @SIGNATUREDISPLAYLABEL | nvarchar(200) | IN | Signaturedisplaylabel |
| @INCLUDEPETITIONDEADLINE | bit | IN | Includepetitiondeadline |
| @DEADLINETEXT | nvarchar(200) | IN | Deadlinetext |
| @DEADLINEDATE | nvarchar(200) | IN | Deadlinedate |
Definition
Copy
create procedure dbo.USP_DATAFORMTEMPLATE_ADD_ACTION_ITEM_PETITION
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@ACTIONITEMID uniqueidentifier,
@GOAL int = 0,
@PETITIONCOUNT int = 0,
@MINCOUNT int = 0,
@STARTCOUNT int = 0,
@SIGNATUREDISPLAY bit = 1,
@HIDEADVOCATEMESSAGE bit = 0,
@THERMOMETERDISPLAY bit = 1,
@COUNTDISPLAY bit = 1,
@THERMOMETERTYPECODE tinyint = 0,
@THERMOMETERPOSITIONCODE tinyint = 2,
@INCLUDEPETITIONCOUNT bit = 1,
@SIGNATUREDISPLAYLABEL nvarchar(200)= 'Signatures',
@INCLUDEPETITIONDEADLINE bit = 1,
@DEADLINETEXT nvarchar(200) = '',
@DEADLINEDATE nvarchar(200) = ''
)
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.ACTIONITEMPETITION
(ID, ACTIONITEMID, GOAL, PETITIONCOUNT, MINCOUNT, STARTCOUNT, SIGNATUREDISPLAY, HIDEADVOCATEMESSAGE, THERMOMETERDISPLAY, COUNTDISPLAY, THERMOMETERTYPECODE, THERMOMETERPOSITIONCODE, INCLUDEPETITIONCOUNT, SIGNATUREDISPLAYLABEL, INCLUDEPETITIONDEADLINE, DEADLINETEXT, DEADLINEDATE, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED)
values
(@ID, @ACTIONITEMID, @GOAL, @PETITIONCOUNT, @MINCOUNT, @STARTCOUNT, @SIGNATUREDISPLAY, @HIDEADVOCATEMESSAGE, @THERMOMETERDISPLAY, @COUNTDISPLAY, @THERMOMETERTYPECODE, @THERMOMETERPOSITIONCODE, @INCLUDEPETITIONCOUNT, @SIGNATUREDISPLAYLABEL, @INCLUDEPETITIONDEADLINE, @DEADLINETEXT, @DEADLINEDATE, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE)
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0