USP_DATALIST_APPUSERWORKSPACEINTERACTION
Returns a list of interactions for the application user's workspace.
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. |
@TYPEFILTERID | uniqueidentifier | IN | Type |
@INCLUDECOMPLETED | bit | IN | Include completed |
Definition
Copy
CREATE procedure dbo.USP_DATALIST_APPUSERWORKSPACEINTERACTION
(
@CURRENTAPPUSERID uniqueidentifier,
@TYPEFILTERID uniqueidentifier = null,
@INCLUDECOMPLETED bit = 0
)
as
set nocount on;
select
INTERACTION.ID,
INTERACTION.FUNDRAISERID,
NF.NAME,
INTERACTION.OBJECTIVE,
INTERACTIONTYPECODE.DESCRIPTION,
INTERACTION.DATE,
INTERACTION.STATUSCODE,
INTERACTION.STATUS
from
dbo.INTERACTION
outer apply
dbo.UFN_CONSTITUENT_DISPLAYNAME(INTERACTION.FUNDRAISERID) NF
left join
dbo.APPUSER on APPUSER.CONSTITUENTID = INTERACTION.FUNDRAISERID
left join
dbo.INTERACTIONTYPECODE on INTERACTIONTYPECODE.ID = INTERACTION.INTERACTIONTYPECODEID
where
APPUSER.ID = @CURRENTAPPUSERID
and INTERACTION.ISINTERACTION = 1
and ( (INTERACTION.INTERACTIONTYPECODEID = @TYPEFILTERID) or (@TYPEFILTERID is null) )
and ( (INTERACTION.STATUSCODE = 1) or (@INCLUDECOMPLETED = 1) );
return 0;