Adding a Record With Payment Lines

This example shows how to add a deposit record using the Payments sublist.

Each line in the Payments sublist must reference an existing transaction that was posted to the Undeposited Funds account. The status of the transaction must either be Undeposited or the transaction can be undefined. The status cannot be Deposited.

You can view a list that includes valid transactions in the user interface. Open the standard entry form for the record, at Transactions > Bank > Make Deposits. Go to the Payments subtab, which is on the Deposits subtab. The Payments subtab shows all transactions available to be used in the sublist.

In the following example, a new record is created with three lines in the Payments sublist.

C#

          private void addDeposit()
{

   // Create object.

   Deposit myDeposit = new Deposit();


   // Set an external Id.

   myDeposit.externalId = "804A";


   // Identify the account that will receive the deposit.

   RecordRef myAccount = new RecordRef();
   myAccount.internalId = "6";
   myDeposit.account = myAccount;


   // Create an instance of the Payment sublist that can take as many as three lines.

   myDeposit.paymentList  = new DepositPaymentList();
   myDeposit.paymentList.depositPayment = new DepositPayment[3];
             

   // Populate the lines using existing payment records that posted to the
   // Undeposited Funds account. The id field points to the internal ID 
   // of the payment record.

   myDeposit.paymentList.depositPayment[0] = new DepositPayment();
   myDeposit.paymentList.depositPayment[0].deposit = true;
   myDeposit.paymentList.depositPayment[0].depositSpecified = true;
   myDeposit.paymentList.depositPayment[0].id = 1969;
   myDeposit.paymentList.depositPayment[0].idSpecified = true;

   myDeposit.paymentList.depositPayment[1] = new DepositPayment();
   myDeposit.paymentList.depositPayment[1].deposit = true;
   myDeposit.paymentList.depositPayment[1].depositSpecified = true;
   myDeposit.paymentList.depositPayment[1].id = 1995;
   myDeposit.paymentList.depositPayment[1].idSpecified = true;

   myDeposit.paymentList.depositPayment[2] = new DepositPayment();
   myDeposit.paymentList.depositPayment[2].deposit = true;
   myDeposit.paymentList.depositPayment[2].depositSpecified = true;
   myDeposit.paymentList.depositPayment[2].id = 1671;
   myDeposit.paymentList.depositPayment[2].idSpecified = true;
           

   // Execute the operation.

   _service.add(myDeposit);

} 

        

SOAP Request

          <soap:Body>
   <add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
      <record xmlns:q1="urn:bank_2017_1.transactions.webservices.netsuite.com" xsi:type="q1:Deposit" externalId="804A">
         <q1:account internalId="6" />
         <q1:paymentList>
            <q1:depositPayment>
               <q1:deposit>true</q1:deposit>
               <q1:id>1969</q1:id>
         </q1:depositPayment>
            <q1:depositPayment>
               <q1:deposit>true</q1:deposit>
               <q1:id>1995</q1:id>
            </q1:depositPayment>
            <q1:depositPayment>
               <q1:deposit>true</q1:deposit>
               <q1:id>1671</q1:id>
            </q1:depositPayment>
            </q1:paymentList>
      </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 internalId="7851" externalId="804A" type="deposit" xsi:type="platformCore:RecordRef" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
      </writeResponse>
   </addResponse>
</soapenv:Body> 

        

Related Topics

Deposit
Deposit Supported Operations
Deposit Code Samples
Adding a Record With Other Deposit, Cash Back Lines
Updating the Deposit Record
Common Errors With Deposit Records
SOAP Web Services Standard Operations
add
SuiteTalk SOAP Web Services Platform Overview
Deposits
Making Deposits
Viewing the Deposits List
General Ledger Impact of Transactions
Bank Transaction GL Impact

General Notices