Example of Getting a Custom Transaction

In some cases, you may want to retrieve a custom transaction instance by using the get operation. When doing a get of most record types, you use the RecordRef class. However, with a custom transaction, you use CustomTransactionRef class.

When creating a CustomTransactionRef object, you identify the custom transaction type by using either the scriptId field or the typeId field. Both fields reference fields on the custom transaction type definition: The scriptId field identifies the field labeled ID in the UI. The typeId field takes the internal ID of the custom transaction type.

By contrast, the CustomTransactionRef’s internal ID field is used to identify the internal ID of the desired transaction instance.

The following sample code shows how to get an instance of the custom transaction type with the script ID customtransaction_fixedasset. The operation retrieves the instance with the internal ID of 9675.

C#

          private void getCustomTrxn()
{ CustomTransactionRef customTrxn = new CustomTransactionRef(); customTrxn.scriptId = "customtransaction_fixedasset"; customTrxn.internalId = "9675"; ReadResponse response = _service.get(customTrxn); } 

        

SOAP Request

          <soap:Body>
   <get xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <baseRef scriptId="customtransaction_fixedasset" internalId="9675" xsi:type="q1:CustomTransactionRef" xmlns:q1="urn:core_2017_1.platform.webservices.netsuite.com"/>
   </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:CustomTransaction" internalId="9675" xmlns:setupCustom="urn:customization_2017_1.setup.webservices.netsuite.com"> <setupCustom:createdDate>2015-03-20T06:09:47.000-07:00</setupCustom:createdDate> <setupCustom:lastModifiedDate>2015-03-20T06:09:47.000-07:00</setupCustom:lastModifiedDate> <setupCustom:tranType internalId="110" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Fixed Asset Accrual</platformCore:name> </setupCustom:tranType> <setupCustom:tranId>1</setupCustom:tranId> <setupCustom:currency internalId="1" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>US Dollar</platformCore:name> </setupCustom:currency> <setupCustom:exchangeRate>1.0</setupCustom:exchangeRate> <setupCustom:tranDate>2015-03-20T00:00:00.000-07:00</setupCustom:tranDate> <setupCustom:postingPeriod internalId="351" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Mar 2015</platformCore:name> </setupCustom:postingPeriod> <setupCustom:tranStatus internalId="A" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Approved</platformCore:name> </setupCustom:tranStatus> <setupCustom:subsidiary internalId="1" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Parent Company</platformCore:name> </setupCustom:subsidiary> <setupCustom:lineList> <setupCustom:customTransactionLine> <setupCustom:account internalId="6" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>10100 Investments</platformCore:name> </setupCustom:account> <setupCustom:debit>1600.0</setupCustom:debit> </setupCustom:customTransactionLine> <setupCustom:customTransactionLine> <setupCustom:account internalId="12" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>10300 Undeposited Funds</platformCore:name> </setupCustom:account> <setupCustom:credit>1600.0</setupCustom:credit> </setupCustom:customTransactionLine> </setupCustom:lineList> <setupCustom:accountingBookDetailList> <setupCustom:customTransactionAccountingBookDetail> <setupCustom:accountingBook internalId="5" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>Jan</platformCore:name> </setupCustom:accountingBook> <setupCustom:currency internalId="1" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"> <platformCore:name>US Dollar</platformCore:name> </setupCustom:currency> <setupCustom:exchangeRate>1.0</setupCustom:exchangeRate> </setupCustom:customTransactionAccountingBookDetail> </setupCustom:accountingBookDetailList> </record> </readResponse>
</getResponse> </soapenv:Body> 

        

Related Topics

get
Custom Transaction
Custom Transaction Body and Sublist Fields
How List Styles Affect Your Integration
Custom Transaction Code Samples
Example of Adding an Instance of a Basic Custom Transaction Type
Example of Adding an Instance of a Journal Custom Transaction Type
How to Use the SOAP Web Services Records Help
SOAP Web Services Supported Records
SOAP Schema Browser
SuiteTalk SOAP Web Services Platform Overview

General Notices