USP_DATAFORMTEMPLATE_EDITLOAD_INTERACTIONMOVE_2
The load procedure used by the edit dataform template "Interaction Move Edit Form 2"
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. |
@TSLONG | bigint | INOUT | Output parameter indicating the TSLONG value of the record being edited. This is used to manage multi-user concurrency issues when multiple users access the same record. |
@EXPECTEDDATE | datetime | INOUT | Expected date |
@ACTUALDATE | datetime | INOUT | Actual date |
@FUNDRAISERID | uniqueidentifier | INOUT | Owner |
@INTERACTIONTYPECODEID | uniqueidentifier | INOUT | Contact method |
@OBJECTIVE | nvarchar(100) | INOUT | Summary |
@STATUSCODE | tinyint | INOUT | Status |
@COMMENT | nvarchar(max) | INOUT | Comment |
@ISSTEP | bit | INOUT | Is step |
@PARTICIPANTS | xml | INOUT | Participants |
@CONSTITUENTID | uniqueidentifier | INOUT | Constituent ID |
@CONSTITUENTNAME | nvarchar(700) | INOUT | Constituent name |
@INTERACTIONCATEGORYID | uniqueidentifier | INOUT | Category |
@INTERACTIONSUBCATEGORYID | uniqueidentifier | INOUT | Subcategory |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDITLOAD_INTERACTIONMOVE_2
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@TSLONG bigint = 0 output,
@EXPECTEDDATE datetime = null output,
@ACTUALDATE datetime = null output,
@FUNDRAISERID uniqueidentifier = null output,
@INTERACTIONTYPECODEID uniqueidentifier = null output,
@OBJECTIVE nvarchar(100) = null output,
@STATUSCODE tinyint = null output,
@COMMENT nvarchar(max) = null output,
@ISSTEP bit = null output,
@PARTICIPANTS xml = null output,
@CONSTITUENTID uniqueidentifier = null output,
@CONSTITUENTNAME nvarchar(700) = null output,
@INTERACTIONCATEGORYID uniqueidentifier = null output,
@INTERACTIONSUBCATEGORYID uniqueidentifier = null output
) as begin
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
select
@DATALOADED = 1,
@TSLONG = I.TSLONG,
@EXPECTEDDATE = I.EXPECTEDDATE,
@ACTUALDATE = I.ACTUALDATE,
@FUNDRAISERID = I.FUNDRAISERID,
@INTERACTIONTYPECODEID = I.INTERACTIONTYPECODEID,
@OBJECTIVE = I.OBJECTIVE,
@STATUSCODE = I.STATUSCODE,
@COMMENT = I.COMMENT,
@ISSTEP = case when I.PROSPECTPLANID is null then 0 else 1 end,
@PARTICIPANTS = dbo.UFN_INTERACTION_PARTICIPANTS_TOITEMLISTXML(I.ID),
@CONSTITUENTID = I.CONSTITUENTID,
@CONSTITUENTNAME = NF.NAME,
@INTERACTIONCATEGORYID = INTERACTIONSUBCATEGORY.INTERACTIONCATEGORYID,
@INTERACTIONSUBCATEGORYID = I.INTERACTIONSUBCATEGORYID
from
dbo.INTERACTION I
cross apply dbo.UFN_CONSTITUENT_DISPLAYNAME(I.CONSTITUENTID) NF
left outer join
dbo.INTERACTIONSUBCATEGORY on I.INTERACTIONSUBCATEGORYID = INTERACTIONSUBCATEGORY.ID
where
I.ID = @ID
-- Bug 168451 - Do not load the form if this is being used for the wrong type of interaction.
-- There was a customization that used Interaction Edit Form 4 form instead of this form, which have the same record type.
and I.PROSPECTPLANID is not null;
return 0;
end