I've never touched SuiteScript, but I believe this...
# suitescript
m
I've never touched SuiteScript, but I believe this should be easy. On a sales order I enter an item. In that item's master record I have connected a custom record with item number as the key. If that custom record has an entry in it I want to put the second column from that record into a custom field on the line item. Should be a basic query. Can someone point me to a help file or manual that should show how to script a query upon item entry like that?
c
does it need to be real time or can it happen on save?
e
@martin.hambalek You'll want to investigate the Sourcing concept:

https://www.youtube.com/watch?v=2mYdf-AnmFk▾

c
or that ^ ha good call
e
It doesn't work for all cases
but it's usually what you want to try first
c
right it may for this one though.. you can almost ALWAYS script something but you may not have to if you can source.. totally agree
m
On save would be fine. I really just need to print it on the form.
c
well id see if you can source it first and then if not, you could just script it to pull it in
m
Ok, the other requirement that I just remembered is that I need to pull the entry from the custom record if there is one, else pull the value from a separate custom field on the item master header. I'm currently doing this today via sourcing. So essentially I need an IF THEN to determine where to pull the value. Which is why I think I needed a script.