USP_DATAFORMTEMPLATE_ADD_RELATIONSHIPMAPINSTANCE
The save procedure used by the add dataform template "Relationship Map Instance Add Data Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@CONTEXTID | nvarchar(137) | IN | Input parameter indicating the context ID for the record being added. |
@RELATIONSHIPMAPID | uniqueidentifier | IN | |
@CONTEXTRECORDID | nvarchar(100) | IN | Context record ID |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@NAME | nvarchar(255) | IN | Name |
@DESCRIPTION | nvarchar(1000) | IN | Description |
@DEFINITIONXML | xml | IN | Definition XML |
@PARAMETERDEFINITIONXML | xml | IN | Parameter definition XML |
@OTHERSCANMODIFY | bit | IN | Allow others to modify this relationship map |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_RELATIONSHIPMAPINSTANCE
(
@ID uniqueidentifier = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@CONTEXTID nvarchar(137),
@RELATIONSHIPMAPID uniqueidentifier,
@CONTEXTRECORDID nvarchar(100),
@CHANGEAGENTID uniqueidentifier = null,
@NAME nvarchar(255),
@DESCRIPTION nvarchar(1000) = '',
@DEFINITIONXML xml,
@PARAMETERDEFINITIONXML xml = null,
@OTHERSCANMODIFY bit = 1
)
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.RELATIONSHIPMAPINSTANCE
(ID, RELATIONSHIPMAPID, CONTEXTRECORDID, NAME, DESCRIPTION, DEFINITIONXML, PARAMETERDEFINITIONXML, OWNERID, OTHERSCANMODIFY, ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED)
values
(@ID, @RELATIONSHIPMAPID, @CONTEXTRECORDID, @NAME, @DESCRIPTION, @DEFINITIONXML, @PARAMETERDEFINITIONXML, @CURRENTAPPUSERID, @OTHERSCANMODIFY, @CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE)
end try
begin catch
exec dbo.USP_RAISE_ERROR;
return 1;
end catch
return 0;