Hey all! Happy Monday! I have a question, I am tr...
# suitescript
m
Hey all! Happy Monday! I have a question, I am trying to create an invoice with 3 lines and in an X scenario, I want to change the account for one of the lines, like:
Copy code
newRecord.setCurrentSublistValue({
  sublistId: 'item',
  fieldId: 'account',
  value: 781
});
And it's not really doing it, it's falling back to the item's account. From my investigation it looks like what I need to do here is a custom GL plugin script for this, but I've found really different opinions online, has anybody ever ran into this? Thank you
a
This sounds like you're making something more complicated than it needs to be. 2 simple options 1. create another "version" of the item with the other account 2. delete that item line entirely and create and expense line with just the account reference you want.
custom GL plugin script are kind of annoying
m
thanks for your response, yeah, another item I think would be ideal since we can just set the account there and forget about it, in terms on the expense line, they don't really use expenses I've worked with a couple custom plugins before and I agree they are a bit painful, but from what I hear you say, we can agree that setting the hardcoding the account to something different on the line level is not really possible
a
correct, you can't independently change the account on an invoice item line. Your GL plugin script approach will work, you'd have to identify the scenario based on w/e business logic, and just credit the regular item account $x and then debit the new target account $x
m
yeah, that fits with what I've found online, it's just those plugin scripts are, like you said, annoying and scary lol
thank you @Anthony OConnor
👍 1