Example of Updating a Custom Segment Value

This example shows how to update an existing custom segment value to include a new name.

The way you update a custom segment value can vary depending on the endpoint and operation you are using. This example uses the 2015.2 endpoint. It demonstrates how to identify the segment by using the internal ID of the appropriate custom record type. This method of identifying the segment is available with all endpoints.

This example also shows how to identify a segment value by its internal ID.

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

C#

           private void updateSegmentValue() { RecordRef myRef = new RecordRef(); myRef.type = RecordType.customRecordType; myRef.internalId = "39"; myRef.typeSpecified = true; CustomRecord myUpdatedSegmentValue = new CustomRecord(); myUpdatedSegmentValue.recType = myRef; myUpdatedSegmentValue.name = "Furniture"; myUpdatedSegmentValue.internalId = "108"; _service.update(myNewSegmentValue); } 

        

SOAP Request

          <soap:Body>
   <update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <record internalId="108" xsi:type="q1:CustomRecord" xmlns:q1="urn:customization_2017_1.setup.webservices.netsuite.com">
         <q1:name>Furniture</q1:name>
         <q1:recType type="customRecordType" internalId="39"/>
      </record>
   </update>
</soap:Body> 

        

SOAP Response

          <soapenv:Body>
   <updateResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <writeResponse>
         <platformCore:status isSuccess="true" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
         <baseRef xsi:type="platformCore:CustomRecordRef" typeId="39" internalId="108" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </updateResponse>
</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 Getting a Custom Segment Value by Using Record ID
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