Is it possible to create a JE after saving a Vendo...
# suitescript
l
Is it possible to create a JE after saving a Vendor Bill where the JE lines will automatically copy the Expense account, Department and Class from the Vendor Bill (but on Credit side of JE)?
m
@Luis you can create an afterSubmit User Event Script to do this
u
If you’re trying to reclassify an expense automatically checkout NetSuite’s Custom GL Lines Plug-in
Sounds like you have set criteria for when you want to credit that expense account. That plugin will automatically create an extra CR-ing GL line that lives in the bill record
l
That is what I'm currently doing @michoel Will it work even if I just want to have the JE on Edit mode (not saved/created) after populating the fields from the VB? I'm planning to remove the .save function so it won't be saved but will be on Edit mode. Will that work?
m
No that won't really work. You want to open the unsaved JE in the UI, but the user event script runs on the server side
You could do something creative like have the UE script redirect to the new journal page with a custom parameter, and then a client script on the JE record checks that and adds the lines
l
@_ludlow @michoel To give more context, I just need to reclassify a Department from the Vendor Bill. It's a VB with amortization schedule. The amortization JE always follows the Department from the source VB (the Dept is disabled on the auto gen amortization JE). The department we set on the source VB is the correct department for the amortization JE so it will just flow through. But for the source VB, it should actually be assigned to a different Department; hence, the need for the JE to reclass the Department from VB. The JE: Debit: Prepaid Expense and Correct Department Credit: Prepaid Expense and 'Wrong/Source VB Department'
@_ludlow @michoel I'll give that custom GL plug-in a try 'cause I could probably add two custom GL lines that debit the Prepaid Expense and the Correct Department and credit the same Prepaid Expense and the Wrong Department.
👍 1