Updating an Item Account Mapping Record
The following example shows how to update an item account mapping record. In this example, the update specifies the use of a different entry form, changes the destination account, and sets the Custom Dimension field to a value of “unassigned.” Be aware that the Custom Dimension field is available only if you have configured it, at Setup > Accounting > Accounting Preferences, on the Accounting Books subtab.
C#
private void updateItemAccountMapping()
{
// create object
ItemAccountMapping updatedItemAccountMapping = new ItemAccountMapping();
// identify the record being updated
updatedItemAccountMapping.externalId = "106D";
// change the form that is being used
RecordRef myCustomForm = new RecordRef();
myCustomForm.type = RecordType.customRecord;
myCustomForm.typeSpecified = true;
myCustomForm.internalId = "-730";
updatedItemAccountMapping.customForm = myCustomForm;
// change the destination account
RecordRef myDestinationAccount = new RecordRef();
myDestinationAccount.type = RecordType.account;
myDestinationAccount.typeSpecified = true;
myDestinationAccount.internalId = "175";
updatedItemAccountMapping.destinationAccount = myDestinationAccount;
// change the custom dimension - update it to the status of "unassigned"
// using internal ID -999
RecordRef myBillingSchedule = new RecordRef();
myBillingSchedule.type = RecordType.billingSchedule;
myBillingSchedule.typeSpecified = true;
myBillingSchedule.internalId = "-999";
updatedItemAccountMapping.customDimension = myBillingSchedule;
// execute update operation
_service.update(updatedItemAccountMapping);
}
SOAP Request
<soap:Body>
<update xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record externalId="106D" xsi:type="q1:ItemAccountMapping" xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com">
<q1:customForm type="customRecordType" internalId="-730"/>
<q1:destinationAccount type="account" internalId="175"/>
<q1:customDimension type="billingSchedule" internalId="-999" xsi:type="q2:RecordRef" xmlns:q2="urn:core_2017_1.platform.webservices.netsuite.com"/>
</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:RecordRef" type="itemAccountMapping" externalId="106D" internalId="404" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
</writeResponse>
</updateResponse>
</soapenv:Body>
Related Topics
- Item Account Mapping
- Adding an Item Account Mapping Record
- Item Account Mapping Supported Operations
- Item Account Mapping Field Definitions
- Common Errors With Item Account Mappings
- Multi-Book Accounting Overview
- Chart of Accounts Mapping
- Item Account Mapping
- Mapping Restrictions
- How to Use the SOAP Web Services Records Help
- SOAP Web Services Operations
- update