Setting approved = true
and approvedSpecified = true
are enough to create an approved journal entry via SuiteTalk. In testing this, I did have to disable an existing workflow that forced new JE's to go into a Pending Approval state. Perhaps you have some other customization that is preventing the creation of a JE in an approved state.
The following code worked for me.
var journal = new JournalEntry
{
tranDate = DateTime.Now,
approved = true,
approvedSpecified = true,
subsidiary = 2.ToRecordRef(),
memo = "test",
lineList = new JournalEntryLineList
{
line = new List<JournalEntryLine>
{
new JournalEntryLine
{
account = 122.ToRecordRef(),
credit = 100F,
creditSpecified = true
},
new JournalEntryLine
{
account = 122.ToRecordRef(),
debit = 100F,
debitSpecified = true
}
}.ToArray()
},
};
var response = ns.add(journal);