UFN_DATAFORMTEMPLATE_GETDEFAULTINSTANCEID

Return

Return Type
uniqueidentifier

Parameters

Parameter Parameter Type Mode Description
@DATAFORMTEMPLATECATALOGID uniqueidentifier IN

Definition

Copy

            Create function dbo.UFN_DATAFORMTEMPLATE_GETDEFAULTINSTANCEID(@DATAFORMTEMPLATECATALOGID uniqueidentifier) returns uniqueidentifier
                as
                begin
                    declare @mode tinyint;
                    declare @specxml xml;
                    declare @dataforminstanceid uniqueidentifier;
                    select @mode=MODE, @specxml=TEMPLATESPECXML from dbo.DATAFORMTEMPLATECATALOG where ID = @DATAFORMTEMPLATECATALOGID

                    if @mode = 0 -- View
                        Select @dataforminstanceid=@specxml.value('declare namespace bbfa="bb_appfx_viewdataformtemplate";/bbfa:ViewDataFormTemplateSpec[1]/@DataFormInstanceID','uniqueidentifier');
                    else
                        if @mode = 1 -- Edit
                            Select @dataforminstanceid=@specxml.value('declare namespace bbfa="bb_appfx_editdataformtemplate";/bbfa:EditDataFormTemplateSpec[1]/@DataFormInstanceID','uniqueidentifier');
                        else
                            Select @dataforminstanceid=@specxml.value('declare namespace bbfa="bb_appfx_adddataformtemplate";/bbfa:AddDataFormTemplateSpec[1]/@DataFormInstanceID','uniqueidentifier');

                    return @dataforminstanceid

                end