Example of Getting a Custom Segment Value by Using Record ID

This example shows how to get an existing custom segment value.

The way you identify a custom segment value varies depending on the endpoint and operation you are using. This example uses the 2017.1 endpoint. It demonstrates how to identify the segment by using the segment’s Record ID value. This method of identifying a segment during the get operation is available only with the 2016.1 endpoint and later.

For details on identifying custom segments and their values, see Identifying Custom Segments and Values Identifying Custom Segments.

C#

          private void getSegmentValue()
{

 CustomRecordRef myNewSegmentValue = new CustomRecordRef();
 myNewSegmentValue.scriptId = "customrecord_cseg_profitcenter";
 myNewSegmentValue.externalId = "Apparel";

 _service.get(myNewSegmentValue);
} 

        

SOAP Request

          <soap:Body> <get xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"> <baseRef scriptId="customrecord_cseg_profitcenter" externalId="Apparel" xsi:type="q1:CustomRecordRef" xmlns:q1="urn:core_2017_1.platform.webservices.netsuite.com"> </baseRef> </get>
</soap:Body> 

        

SOAP Response

          <soapenv:Body> <getResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com"> <readResponse> <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/> <record xsi:type="setupCustom:CustomRecord" externalId="Apparel" internalId="8" xmlns:setupCustom="urn:customization_2017_1.setup.webservices.netsuite.com"> <setupCustom:isInactive>false</setupCustom:isInactive> <setupCustom:name>Apparel</setupCustom:name> <setupCustom:owner internalId="-4" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>-System-</platformCore:name> </setupCustom:owner> <setupCustom:recType internalId="39" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Profit Center</platformCore:name> </setupCustom:recType> </record> </readResponse> </getResponse>
</soapenv:Body> 

        

Related Topics

Working With Custom Segment Values
Identifying Custom Segment Values
Example of Dynamic Discovery of Existing Custom Segments
Example of Adding a Custom Segment Value
Example of Updating a Custom Segment Value
Example of Deleting a Custom Segment Value by Using Record ID
Example of Getting a Custom Segment Value by Using Type Internal ID
Example of Deleting a Custom Segment Value by Using Type Internal ID

General Notices