Mike Sickler
Mike Sickler

Reputation: 34451

SuiteTalk: how do I get Custom Segment list values

I can get a list of custom segments using this code:

List<CustomizationRef> getCustIdResult = client.getCustomizationId(GetCustomizationType.customSegment, true);
if (getCustIdResult == null)
    return new ArrayList();

List<?> returnedRows = client.getRecords(getCustIdResult);

But that just gives me the segments names and IDs, but not the list values. How do I get the values?

Upvotes: 0

Views: 1051

Answers (1)

Martha
Martha

Reputation: 764

Per Suite Answer 84991 using SuiteTalk SOAP Web Services you can list existing custom segments using the getCustomizationId operation. To get the custom segment values use the CustomRecordSearch operations.

Suite Answer 84991 also state: "When a custom segment is applied to either a custom record type or one of the other record types on the Application & Sourcing subtab of a custom segment, you cannot retrieve information about the field which was created from the custom segment using its script ID and customizationRef. You can only get the field information through its internal ID." So be mindful of this.

Suite Answer 65812 provides the following example of getting the values from a custom segment:

<soapenv:Body>
 <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
  <searchRecord xsi:type="ns7:CustomRecordSearchBasic" xmlns:ns7="urn:common_2017_1.platform.webservices.netsuite.com">
   <ns7:recType internalId="24" scriptId="customrecord_cseg_example" type="customRecordType" xsi:type="ns8:CustomizationRef" xmlns:ns8="urn:core_2017_1.platform.webservices.netsuite.com">
    <ns8:name xsi:type="xsd:string">WS Segment Example</ns8:name>
   </ns7:recType>
  </searchRecord>
 </search>
</soapenv:Body>

Upvotes: 1

Related Questions