Adding a Global Account Mapping Record

The following example shows how to create a global account mapping record. This example assumes that the Custom Dimension field has been configured to reference currency type. Note also that this example does not set an end date, which means that the mapping will work indefinitely.

C#

          private void addGlobalAccountMapping()
{

   // create object

   GlobalAccountMapping newGlobalAccountMapping = new GlobalAccountMapping();
            

   // create external Id

   newGlobalAccountMapping.externalId = "101A";

                                                
   // set effective date

   DateTime lastWeek = new DateTime(2013, 1, 20);
   newGlobalAccountMapping.effectiveDate = lastWeek;
   newGlobalAccountMapping.effectiveDateSpecified = true;


   // set accounting book

   RecordRef accountingBook = new RecordRef();
   accountingBook.internalId = "2";
   newGlobalAccountMapping.accountingBook = accountingBook;
            

   // set subsidiary
            
   RecordRef subsidiaryRef = new RecordRef();
   subsidiaryRef.internalId = "2";
   newGlobalAccountMapping.subsidiary = subsidiaryRef;
            

   // set source account

   RecordRef sourceAccount = new RecordRef();
   sourceAccount.internalId = "112";
   newGlobalAccountMapping.sourceAccount = sourceAccount;


   // set destination account
            
   RecordRef destinationAccount = new RecordRef();
   destinationAccount.internalId = "11";
   newGlobalAccountMapping.destinationAccount = destinationAccount;


   // set custom dimension - in this case, the custom dimension field
   // has been configured to reference a particular currency.

   RecordRef currencyType = new RecordRef();
   currencyType.internalId = "1";
   newGlobalAccountMapping.customDimension = currencyType;


   //execute add operation

   _service.add(newGlobalAccountMapping);    

} 

        

SOAP Request

          <soap:Body>
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <record xsi:type="q1:GlobalAccountMapping" xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com">
         <q1:effectiveDate>2013-01-20T00:00:00</q1:effectiveDate>
         <q1:accountingBook internalId="2"/>
         <q1:subsidiary internalId="2"/>
       <q1:sourceAccount internalId="112"/>
       <q1:destinationAccount internalId="11"/>
         <q1:customDimension internalId="1" xsi:type="q2:RecordRef" xmlns:q2="urn:core_2017_1.platform.webservices.netsuite.com"/>
    </record>
 </add>
</soap:Body> 

        

SOAP Response

          <soapenv:Body>
   <addResponse 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="globalAccountMapping" internalId="2" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Related Topics

General Notices