USP_DATAFORMTEMPLATE_ADD_APPUSERSYSTEMROLE_PRELOAD
The load procedure used by the edit dataform template "Application User System Role Add Form"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@SITEHIERARCHY | xml | INOUT | Hierarchy |
@APPUSERID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_APPUSERSYSTEMROLE_PRELOAD
(
@SITEHIERARCHY xml = null output,
@APPUSERID uniqueidentifier
)
as
begin
select
@SITEHIERARCHY = (
select
SITE.ID as SITEID,
(select
PARENTSITE.ID
from
dbo.SITE AS PARENTSITE
where
SITE.HIERARCHYPATH.GetAncestor(1) = PARENTSITE.HIERARCHYPATH
) as PARENTSITEID,
SITE.NAME,
row_number() over (partition by SITE.HIERARCHYPATH.GetAncestor(1) order by HIERARCHYPATH) as SEQUENCE,
newid() as SYSTEMROLEAPPUSERSITEID
from
dbo.SITE
order by
HIERARCHYPATH
for
xml raw('ITEM'),type,elements,root('SITEHIERARCHY'),BINARY BASE64
)
end