Adding a Book Specific Journal Entry
The following example shows how to create a book specific journal entry record that has two sublist lines.
Note that with this type of journal entry, you should not set a value for the currency field. There is only one valid currency for a book specific journal entry. The system automatically populates this field. The value is based on the values you choose for the journal entry’s subsidiary and accounting book fields.
C#
private void addBookSpecificJournalEntry()
{
JournalEntry newJournalEntry = new JournalEntry();
newJournalEntry.externalId = "105A";
RecordRef mySubsidiary = new RecordRef();
mySubsidiary.internalId = "10";
newJournalEntry.subsidiary = mySubsidiary;
RecordRef myAccountingBook = new RecordRef();
myAccountingBook.internalId = "2";
newJournalEntry.accountingBook = myAccountingBook;
RecordRef myDebitAccount = new RecordRef();
myDebitAccount.internalId = "214";
RecordRef myCreditAccount = new RecordRef();
myCreditAccount.internalId = "215";
newJournalEntry.lineList = new JournalEntryLineList();
newJournalEntry.lineList.line = new JournalEntryLine[2];
newJournalEntry.lineList.line[0] = new JournalEntryLine();
newJournalEntry.lineList.line[0].account = myDebitAccount;
newJournalEntry.lineList.line[0].debit = 21000;
newJournalEntry.lineList.line[0].debitSpecified = true;
newJournalEntry.lineList.line[1] = new JournalEntryLine();
newJournalEntry.lineList.line[1].account = myCreditAccount;
newJournalEntry.lineList.line[1].credit = 21000;
newJournalEntry.lineList.line[1].creditSpecified = true;
_service.add(newJournalEntry);
}
SOAP Request
<soap:Body>
<add xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
<record externalId="105A" xsi:type="q1:JournalEntry" xmlns:q1="urn:general_2017_1.transactions.webservices.netsuite.com">
<q1:accountingBook internalId="2"/>
<q1:subsidiary internalId="10"/>
<q1:lineList>
<q1:line>
<q1:account internalId="214"/>
<q1:debit>21000</q1:debit>
</q1:line>
<q1:line>
<q1:account internalId="215"/>
<q1:credit>21000</q1:credit>
</q1:line>
</q1:lineList>
</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="journalEntry" externalId="105A" internalId="18" xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com"/>
</writeResponse>
</addResponse>
</soapenv:Body>
Related Topics
- Journal Entry Supported Operations
- Journal Entry Body and Sublist Fields
- Journal Entry Code Samples
- Common Errors With Journal Entries
- Journal Entry
- Planning for Multi-Book Accounting
- Using Multi-Book Accounting
- Journal Entries
- Transactions
- Usage Notes for Transaction Record Types
- Transaction Search
- SOAP Schema Browser
- SuiteTalk SOAP Web Services Platform Overview