I am trying to achieve automating customer payment...
# suitescript
s
I am trying to achieve automating customer payment against credit amount(journal entry,credit memo& unapplied payments). For example -ABC Customer has unapplied payment of Rs 10000,credit memo of Rs 5000, and journal entry of Rs 2000. I am creating of invoice 50000 ,Upon saving of invoice ,in a UserEvent trigger i am trying to knock off the invoice amount 50000 with the existing credit amount of Rs 17000.In this scenario i can't apply journal entry amount of Rs 2000.I need to establish a link between Journal and the customer invoice.Please provide the script bundle for this entire customization.please do the needful asap.
b
your approach sounds wrong
normally you would create a customer payment transaction to apply all those different transactions to the invoice
s
Thanks for your reply.yes i have to auto apply journal entry amount against invoice(userevent aftersubmit).How can i acheive that.
b
learn how to create a customer payment for that invoice using the ui
should involve clicking the
Accept Payment
button on the invoice and then applying the appropriate credits towards that payment
s
hactually i need automate applying the credits towards that payment...i that i please let me know how to apply journal credit for that customer
b
can you do it in the ui?
s
yes i can...i need to replicate the same issue in suitescript
b
you do the same thing in script
you use record.transform to mimic the effect of the
Accept Payment
button
then Record.setSublistValue to mark the same checkboxes you would in the ui
that will usually involve using Record.findSublistLineWithValue or Record.getSublistValue to find which line you want to mark
s
i tried with record.transform but its creating a new payment record...problem that payment amount is again credited to customer paymnet
i need to knock off credit amount(journal entry amount) without creating a payment record
just i need to establish a link between journal and invoice record
b
there is no native equivalent for what you are asking for
you need to create the customer payment to properly record the application of credits
netsuite might not actually create the customer payment if the credits balance out the payment amount to 0, but it will apply the chosen crediting transactions to your invoice