USP_DATAFORMTEMPLATE_VIEW_CMSUSERSOCIALPROFILE

The load procedure used by the view dataform template "CMS User Social Profile View"

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.
@POINTS int INOUT Points
@LASTLOGINDATE datetime INOUT Last login
@ISREGISTERED bit INOUT Is registered

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_CMSUSERSOCIALPROFILE
(
    @ID uniqueidentifier,
    @DATALOADED bit = 0 output,
    @POINTS int = null output,
    @LASTLOGINDATE datetime = null output,
    @ISREGISTERED bit = null output
)
as
    set nocount on;

    -- be sure to set this, in case the select returns no rows

    set @DATALOADED = 0;

    select @DATALOADED = 1,
           @POINTS = p.POINTS,
           @LASTLOGINDATE = p.LASTLOGINDATE
    from dbo.constituent c
    inner join dbo.BackOfficeSystemPeople b on b.BackofficeRecordID=c.SEQUENCEID and b.BackOfficeSystemID =0
    inner join dbo.BackOfficeSystemUsers u on u.BackofficePeopleID=b.id
    inner join dbo.clientusers cu on u.ClientUsersID=cu.id
    inner join dbo.CMSUSERSOCIALPROFILE p on cu.id=p.CMSUSERID

    where c.ID = @ID

    set @ISREGISTERED = @DATALOADED

    --set dataloaded so the form will load

    set @DATALOADED = 1

    return 0;