USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTATIONASKLADDEROVERRIDES
The load procedure used by the edit dataform template "Marketing Effort Ask Ladder Overrides Edit 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. |
@SEGMENTATIONACTIVE | bit | INOUT | Active |
@ITEMLIST | xml | INOUT | Ask ladder overrides |
@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. |
@BASECURRENCYID | uniqueidentifier | INOUT | Base currency ID |
@MAILINGTYPECODE | tinyint | INOUT |
Definition
Copy
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_EDITLOAD_MKTSEGMENTATIONASKLADDEROVERRIDES]
(
@ID uniqueidentifier,
@DATALOADED bit = 0 output,
@SEGMENTATIONACTIVE bit = null output,
@ITEMLIST xml = null output,
@TSLONG bigint = 0 output,
@BASECURRENCYID uniqueidentifier = null output,
@MAILINGTYPECODE tinyint = null output
)
as
set nocount on;
set @DATALOADED = 0;
set @TSLONG = 0;
/* WI 261721: When efforts are created from templates (acknowledgement, membership, or sponsorship), the ask ladder overrides have already
been copied to the MKTSEGMENTAITONASKLADDEROVERRIDE table. Setting the mailingtypecode to marketing effort specifies this is
where they should be loaded. */
set @MAILINGTYPECODE = 0;
select
@DATALOADED = 1,
@SEGMENTATIONACTIVE = [ACTIVE],
@BASECURRENCYID = [BASECURRENCYID]
from dbo.[MKTSEGMENTATION]
where [ID] = @ID;
if @DATALOADED = 1 and @SEGMENTATIONACTIVE = 0
begin
-- check if the mailing is currently being activated
declare @R int;
exec @R = dbo.[USP_MKTSEGMENTATION_CHECKACTIVATION] @ID;
if @R <> 0
begin
set @DATALOADED = 0;
return 1;
end
end
set @ITEMLIST = dbo.[UFN_MKTSEGMENTATIONASKLADDEROVERRIDE_GETITEMLIST_TOITEMLISTXML](@ID);
return 0;