Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
How do I apply invoice with advInterCompanyJournalEntry using REST API?
I have been applying credit memo successfully as shown below, but I couldn't find a way to apply Invoice as well against AICJE?
Can someone help me point in right direction?
const applyPayload = {
"amount": creditTotal,
"apply": true,
"doc": {
"links": [],
"id": response.id,
"refName": response.id
},
"due": creditTotal,
"total": creditTotal,
"line": 3,
"type": "Journal"
};
console.log("Payload for applying journal entry to credit memo:", applyPayload);
const applyResponse = await utils.patchData(`/services/rest/record/v1/creditmemo/${creditMemoId}/apply/doc=${response.id},line=3`, applyPayload);
if (applyResponse) {
console.log(`[CreateJournalEntry] Journal entry applied successfully to credit memo ${creditMemoId}`);
return response.id;
} else {
throw new Error(`Failed to apply journal entry to credit memo ${creditMemoId}`); 0