UFN_CLIENTUSERID_GET_BY_CONSTITUENT
Provide client user id from constituent id
Return
Return Type |
---|
int |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CONSTITUENTID | uniqueidentifier | IN |
Definition
Copy
create function [dbo].[UFN_CLIENTUSERID_GET_BY_CONSTITUENT]
(
@CONSTITUENTID uniqueidentifier
)
returns int
as
begin
declare @ID int = null;
select top 1 @ID = CU.ID
from dbo.CONSTITUENT C(nolock)
inner join dbo.BackOfficeSystemPeople BOSP(nolock)
on BOSP.BackofficeRecordID = C.SEQUENCEID and BOSP.BackOfficeSystemID = 0
inner join dbo.BackOfficeSystemUsers BOSU(nolock)
on BOSU.BackofficePeopleID = BOSP.ID and BOSU.[CURRENT] = 1
inner join dbo.ClientUsers CU(nolock)
on CU.ID = bosu.ClientUsersID and CU.Deleted = 0
and C.ID = @CONSTITUENTID
return @ID;
end