USP_DATAFORMTEMPLATE_EDIT_PAGEMODEL

The save procedure used by the edit dataform template "PageModel 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.
@MODELNAME nvarchar(256) IN Modelname
@MODELID uniqueidentifier IN Modelid
@MODELVERSION int IN Modelversion
@CLIENTSITESID int IN Clientsites
@SPECXML nvarchar(max) IN Specxml
@DATELASTIMPORT datetime IN Datelastimport
@LASTIMPORTERROR nvarchar(2048) IN Lastimporterror
@LOCKARTIFACTS bit IN Lockartifacts

Definition

Copy

CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_PAGEMODEL
(
    @ID uniqueidentifier,
    @CHANGEAGENTID uniqueidentifier = null,
    @MODELNAME nvarchar(256),
    @MODELID uniqueidentifier,
    @MODELVERSION int,
    @CLIENTSITESID int,
    @SPECXML nvarchar(max),
    @DATELASTIMPORT datetime,
    @LASTIMPORTERROR nvarchar(2048),
    @LOCKARTIFACTS bit
)
as

    set nocount on;

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

    begin try
        -- handle updating the data
        update dbo.PAGEMODEL set
            MODELNAME = @MODELNAME,
            MODELID = @MODELID,
            MODELVERSION = @MODELVERSION,
            CLIENTSITESID = @CLIENTSITESID,
            SPECXML = @SPECXML,
            DATELASTIMPORT = @DATELASTIMPORT,
            LASTIMPORTERROR = @LASTIMPORTERROR,
            LOCKARTIFACTS = @LOCKARTIFACTS,
            CHANGEDBYID = @CHANGEAGENTID,
            DATECHANGED = getdate()
        where ID = @ID
    end try
    begin catch
        exec dbo.USP_RAISE_ERROR
        return 1
    end catch

return 0;