Custom Segment Value Filtering

To filter a segment in SuiteCloud Development Framework (SDF), set the filteredby element in the custom segment that requires filtering. You can set this value to multiple custom segment references, as displayed in the following example:

          <customsegment scriptid="cseg_campaignmedium">
    ...
    <filteredby>[scriptid=cseg_region]|[scriptid=cseg_other]|...</filteredby>
    ...
</customsegment> 

        

When filtering a custom segment by another custom segment, the instances in the associated custom record type are filtered by the other custom segment using a special custom filterby element. This custom element has the following syntax and can be used in any instance structure of an associated custom record type:

          <customrecordtype scriptid="customrecord_cseg_SCRIPTID">
    ...
    <instances>
        <instance scriptid="_SEGMENTVALUEID">
            <SEGMENT-SCRIPTID1_filterby_SEGMENT-SCRIPTID2>
                [scriptid=SCRIPTID-OF-INSTANCE-FROM-SEGMENT-SCRIPTID2]|
                [scriptid=SCRIPTID-OF-INSTANCE-FROM-SEGMENT-SCRIPTID2]|
                ...
            </SEGMENT-SCRIPTID1_filterby_SEGMENT-SCRIPTID2>
        </instance>
        ...
    </instances>
    ...
</customrecordtype> 

        

Replace SEGMENT-SCRIPTID1 with the script ID of the segment that requires filtering. Replace SEGMENT-SCRIPTID2 with the script ID of the segment that contains the instances that should filter the SEGMENT-SCRIPTID1 instances. Set the value of this element to the SDF custom object instance script ID references that apply. For more information about SDF custom object references, see Specifying an SDF Custom Object Reference.

For example, the customrecord_cseg_campaignmedium from the campaign donor scenario uses this custom element. This associated custom record contains several possible communication medium values. However, some of these values are only applicable for specific regions. The cseg_campaignmedium_filterby_cseg_region element is used to specify the regions for each medium where they are applicable. The following snippet from the customrecord_cseg_campaignmedium shows all the regions where Events, Email, and Website are valid campaign mediums:

          <customrecordtype scriptid="customrecord_cseg_campaignmedium">
    ...
    <instances>
        <instance scriptid="_events">
            <cseg_campaignmedium_filterby_cseg_region>
                [scriptid=customrecord_cseg_region._northeast]|
                [scriptid=customrecord_cseg_region._new_england]|
                [scriptid=customrecord_cseg_region._mid_atlantic]|
                [scriptid=customrecord_cseg_region._midwest]|
                [scriptid=customrecord_cseg_region._east_north_central]|
                [scriptid=customrecord_cseg_region._west_north_central]
            </cseg_campaignmedium_filterby_cseg_region>
            <isinactive>F</isinactive>
            <name>Events</name>
        </instance>
        <instance scriptid="_email">
            <cseg_campaignmedium_filterby_cseg_region>
                [scriptid=customrecord_cseg_region._northeast]|
                [scriptid=customrecord_cseg_region._south]|
                [scriptid=customrecord_cseg_region._west]
            </cseg_campaignmedium_filterby_cseg_region>
            <isinactive>F</isinactive>
            <name>Email</name>
        </instance> 
        <instance scriptid="_website">
            <cseg_campaignmedium_filterby_cseg_region>
                [scriptid=customrecord_cseg_region._west]|
                [scriptid=customrecord_cseg_region._mountain]|
                [scriptid=customrecord_cseg_region._pacific]
            </cseg_campaignmedium_filterby_cseg_region>
            <isinactive>F</isinactive>
            <name>Website</name>
        </instance>
        ...
    </instances>
    ...
</customrecordtype> 

        

For more information about:

Related Topics

General Notices