USP_DATAFORMTEMPLATE_VIEW_MERGERORGINFO
The load procedure used by the view dataform template "Organization Merger Information View 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. |
@HASPARENTANDCHILDREN | bit | INOUT | HASPARENTANDCHILDREN |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_MERGERORGINFO
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@HASPARENTANDCHILDREN bit = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @HASPARENTANDCHILDREN = 0
if exists(
select
ORG.ID
from
dbo.ORGANIZATIONDATA ORG
inner join dbo.ORGANIZATIONDATA CHILD on ORG.ID = CHILD.PARENTCORPID
where
ORG.ID = @ID
AND ORG.PARENTCORPID IS NOT NULL)
set @HASPARENTANDCHILDREN = 1
set @DATALOADED = 1
return 0;