USP_DATAFORMTEMPLATE_PRELOAD_ADD_MKTSEGMENTGROUP
The load procedure used by the edit dataform template "Segment Group Add Form"
Parameters
| Parameter | Parameter Type | Mode | Description | 
|---|---|---|---|
| @CURRENTAPPUSERID | uniqueidentifier | IN | Input parameter indicating the ID of the current user. | 
| @CONTEXT | nvarchar(40) | IN | Input parameter indicating the context ID for the record being added. | 
| @SEGMENTFAMILYTYPECODE | tinyint | INOUT | Segment family type code | 
| @BASECURRENCYID | uniqueidentifier | INOUT | Base currency ID | 
| @SITEID | uniqueidentifier | INOUT | Site | 
| @SITEREQUIRED | bit | INOUT | Site required? | 
| @SEGMENTSREQUIRED | bit | INOUT | 
Definition
 Copy 
                                    
CREATE procedure dbo.[USP_DATAFORMTEMPLATE_PRELOAD_ADD_MKTSEGMENTGROUP]
(
  @CURRENTAPPUSERID uniqueidentifier,
  @CONTEXT nvarchar(40),
  @SEGMENTFAMILYTYPECODE tinyint = null output,
  @BASECURRENCYID uniqueidentifier = null output,
  @SITEID uniqueidentifier = null output,
  @SITEREQUIRED bit = null output,
  @SEGMENTSREQUIRED bit = null output
)
as
  set nocount on;
  set @SEGMENTSREQUIRED = 0;
  exec dbo.[USP_MKTSEGMENTGROUP_PARSECONTEXTID] @CONTEXT, @SEGMENTFAMILYTYPECODE output, @BASECURRENCYID output;
  if @BASECURRENCYID is null
    set @BASECURRENCYID = dbo.[UFN_APPUSER_GETBASECURRENCY](@CURRENTAPPUSERID);
  else
    -- base currency ID is passed in from SegmentationSegmentGroup.Add.xml and SegmentationPassiveSegmentGroup.Add.xml
    -- in these cases, it makes no sense to allow a segment group to be added that contains no segments
    -- thus, in those situations, the client will require at least one segment to be included
    set @SEGMENTSREQUIRED = 1;
  set @SITEID = dbo.[UFN_APPUSER_DEFAULTSITEFORUSER](@CURRENTAPPUSERID);
  set @SITEREQUIRED = dbo.[UFN_SITEREQUIREDFORUSERONFEATURE](@CURRENTAPPUSERID, '3C4C41E5-FEEE-4AD4-9065-393DD5105C99', 1);
  return 0;