Hi - my vendor has multiple warehouses. I have all...
# suitescript
g
Hi - my vendor has multiple warehouses. I have all the addresses under the address tab on my vendor. Any way to get a drop down to chose the address on a PO? I would want this for Dropshipping so I can chose whihc warehouse the order should ship from
t
Are you wanting to control which warehouse a vendor uses to ship to you, or which vendor's warehouse you want to dropship from?
b
its usually more work than is worth it if you are going to script setting the address
otherwise you select address book as your List/Record field, and must create a new entity select field to use as the Source List of the address book
the vendor select on the purchase order does not count, you need to make your own entity custom field that you need to fill in to match the vendor on the purchase order
g
@battk Thanks again. So I will probably be using it in a few different scripts so might be worth it in the long run.... thanks for explaining... i was trying to make the vendor my List/Record and then I kept getting stuck on my filters
@battk they wanted IF first. SO now working on this.... I want to make sure I have the steps clear 1. create a new entity select field on what? that should be used as the Source List of the address book 2. create a new custom record of list/record sourced from the address book. What record type should be selected though? 3. then a new field on the PO to select the address (going to have to filter based on selected vendor)
wait its going to be a transaction body field so i take back the first question
Its a custom trans body field that I will put on the PO.... what do i source and filter it from?
b
you asked in the suitescript channel so you got a scripted answer
you create an entity field on the transaction body
use suitescript to match it to the entity set on your transaction
then use your custom entity field to use for sourcing on your custom addressbook field
g
@battk sorry for asking not smart Qs but what type of script? UE on the transaction save?
b
depends on the context
the general idea is that you can't use the entity fields on the transaction, so you have to make your own and copy the value
you can use whatever tool works for you
g
@battk Thanks a million!! kids were sick so i was out. Just did this and loooks good... value doesnt save... Itry to select one address from the drop down and doesnt save... cacn it be because the field is addressbook and actual value is text / addresss ? How do i get around that?
b
the field should be able to be set as long as you setup the field to store value
g
hmmm. so something else is up
thanks
b
keep in mind that addressbooks and addresses are different things
addressbook refers to the lines of the addressbook sublist of an entity
address is a subrecord that can be accessed from entities and transactions
basically one address per addressbook line, though that relatinship is not available for sourcing purposes
g
so if the custom field is an addressbook how would I be able to save the address ?
@battk
im confused. isnt what you suggested to make a addressbook field?
b
correct, the addressbook is the one with a relationship to an entity
which is why you are able to use it for sourcing
you will need to script your own field if you need the address text
usually by doing a search to get that information
g
@battk what does it help to have a drop-down with the address options and not able to select them? which from what i am understanding is what you suggestion originally?
b
you can select addressbook options
they are not the same as the address options
an addresbook select will allow you to select an address book line
g
but what would cause hte addressbook line not to save?
b
dont know, you havent shared enough of the configuration of your custom field to give guesses
g
@battk 2 Transaction Body Fields. 1)Vendor Address Entity: custbody_vendor_address_entity => I have a UE that sets this to the entity on the PO 2) Vendor Addresses: custbody_vendor_addresses Source List: Select Address Source From: Entity Source Filter By: Entity => The only place it gives me an option to use the first field is the Source List but that doesnt either make sense to me. What would make sense i think is Source List: Vendor Source From: Address Source Filter By: Vendor Address Entity (custom) => this is not an option
b
still not good enough of a description
it looks like you are doing the 2 things i told you not to do
you cant use address as the select
nor can you filter by the native entity fields
g
just updated the post
@battk i do not have the option for my new field
b
dont recognize what a select address is
it should be your custom field that is an entity select
g
and then what source - has to be the same type of field
b
you have 2 options for filtering
use the source filter by
or use that filtering sublist
either one will work
g
the only option in source filter by is entity
I dont thikn ive ever felt so learning disabled... like im missing a peice h ere
@battk Entity is the only option tho. cant get my field
b
you use the source list as the custom entity field
you use the source filter by as the entity (of the addressbook)
you are filtering address book select options by their entity field, which should match against your custom entity field
g
Aha! thanks for your patiencei n explaining it!!! Now let me see it working 🙂 trying it
but now i have the same problem - it doesnt save
b
as in the custom field doesnt save values?
or that you cant save the transaction body field
g
When I edit my PO, I get the drop down with the right addresses. Select One, when I click save it disappears
b
my guess is that its your user event script
g
its not touching that field tho
b
disable it anyways
there are only 2 custom fields involved here
and probably only 1 user event script messing with them
g
you're right. should have added anyways to not run if the entity field is set
THanks! Done!