This is actually a WF question but I think I won’t...
# suitescript
j
This is actually a WF question but I think I won’t be able to solve it with WF alone and will need scripting. On copy/create of a Transaction I want to trigger the Billing Address to source from the current value on the Customer (otherwise a previous/old address might copy over). If I try setting it via WF Set Field Value directly, it doesn’t work, I think because I actually need to set the drop-down’s value (labeled here as Agent/Broker Select) instead of the text address.
b
basics of addresses are that there are 2 internal ids
one is the internal id of the address book line (the internal id of the address book join)
j
how would I get the ID that I’d need to put under Agent/Broker Select? In this example it is 13102
b
the other is the internal id of the address ( the internal id of the address join)
the id you want to use is the internal id of the addresbook
i usually just do a customer search and use the address join to get the information
in your case, the billing address join
j
I’m still not sure how to get the “other” id which I think is what I need
b
make your customer search in the ui
j
I’ve done that, it’s returning nkey not id
b
take a look at the columns available to you in the billing address join
j
ahhhh
Address Internal Id
doesn’t seem to be in SuiteQL, dang
b
it should be in there somewhere, i forgot where it was
i usually use searches
j
I’m doing most stuff in SuiteQL now, way shorter code and faster to write
easy-peasy multi-joins etc
If I do
SELECT * from entityaddress WHERE nkey = 127318
there’s no field with the internalid
Ahhh
SELECT * from entityaddressbook
this works
b
i was about to say, there is a difference between the address and addressbook
which is the first thing i told you
j
yes, I knew that
but that didn’t answer my question about how to get the id I needed
b
but for what you actually want to do, you may want to try unsetting the address text field before you go through all the trouble of resetting fields
j
All I needed is a way to retrieve that ID. This seems to work
SELECT internalid from entityaddressbook WHERE entity = 16357 AND defaultbilling = 'T'