USP_DATAFORMTEMPLATE_VIEW_SMARTQUERYPAGEEXPRESSION
The load procedure used by the view dataform template "Smart query page expression form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@NAME | nvarchar(255) | INOUT | Name |
@RECORDTYPEID | uniqueidentifier | INOUT | Record type |
@PRIMARYKEYFIELD | nvarchar(100) | INOUT | Primary key field |
@ISBROWSABLE | bit | INOUT | Is browsable |
@OWNERID | uniqueidentifier | INOUT | Owner ID |
@OTHERSCANMODIFY | bit | INOUT | OTHERSCANMODIFY |
@CURRENTAPPUSERID | uniqueidentifier | IN | |
@FAVORITE | bit | INOUT |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_SMARTQUERYPAGEEXPRESSION
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@NAME nvarchar(255) = null output,
@RECORDTYPEID uniqueidentifier = null output,
@PRIMARYKEYFIELD nvarchar(100) = null output,
@ISBROWSABLE bit = null output,
@OWNERID uniqueidentifier = null output,
@OTHERSCANMODIFY bit = null output,
@CURRENTAPPUSERID uniqueidentifier = null,
@FAVORITE bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
select
@DATALOADED = 1,
@NAME = q.NAME,
@RECORDTYPEID = c.RECORDTYPEID,
@OWNERID = q.OWNERID,
@OTHERSCANMODIFY = q.OTHERSCANMODIFY,
@PRIMARYKEYFIELD = c.SMARTQUERYSPEC.value('declare namespace ns="bb_appfx_smartquery"; /ns:SmartQuerySpec[1]/@PrimaryKeyField', 'nvarchar(100)'),
@FAVORITE = case when f.ID is not null then convert(bit, 1) else convert(bit, 0) end
from
dbo.SMARTQUERYINSTANCE q inner join
dbo.SMARTQUERYCATALOG c on q.SMARTQUERYCATALOGID = c.ID
left join dbo.APPUSERSMARTQUERYINSTANCEFAVORITE f on q.ID = f.SMARTQUERYINSTANCEID and f.APPUSERID = @CURRENTAPPUSERID
where q.ID = @ID;
if len(@PRIMARYKEYFIELD) = 0
set @ISBROWSABLE = 0;
else
set @ISBROWSABLE = 1;
return 0;