USP_DATAFORMTEMPLATE_VIEW_GLACCOUNTSTRUCTURE_SUMMARY
The load procedure used by the view dataform template "Account Structure Summary View"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@STRUCTUREDATA | xml | INOUT | Current Structure |
@SEPARATOR | nvarchar(1) | INOUT | Separator |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_GLACCOUNTSTRUCTURE_SUMMARY
(
@DATALOADED bit = 0 output,
@STRUCTUREDATA xml = null output,
@SEPARATOR nvarchar(1) = null output
)
as
set nocount on;
declare @PDACCOUNTSYSTEMID uniqueidentifier = '4B121C2C-CCE6-440D-894C-EA0DEF80D50B'
-- We always want to show this view, even if there's no data
set @DATALOADED = 1;
set @STRUCTUREDATA = (select
DESCRIPTION as [NAME],SEQUENCE, LENGTH, ELEMENTTYPECODE as TYPECODE
from dbo.PDACCOUNTSTRUCTURE where PDACCOUNTSYSTEMID = @PDACCOUNTSYSTEMID and ISBASICGL = 0
order by SEQUENCE
for xml raw('ITEM'),elements,type,root('STRUCTUREDATA'),binary base64)
select top 1 @SEPARATOR = SEPARATOR from dbo.PDACCOUNTSTRUCTURE where PDACCOUNTSYSTEMID = @PDACCOUNTSYSTEMID and ISBASICGL=0;
return 0;