- when searching a sales order, the customer is th...
# suitescript
k
• when searching a sales order, the customer is the "entity" field, which the schema browser states is a RecordRef. specifying the column as {"name": "entity"} succeeds, but specifying it as {"name": "internalid", "join": "entity"} fails • when searching a customer deposit, the customer is the "customer" field, which the schema browser also states is a RecordRef. specifying the column as {"name": "internalid", "join": "customer"} succeeds, but specifying it as {"name": "customer"} fails what's the differentiating factor here? how do i know whether i need to join something or not?
e
In the context of a Search, Customer Deposits and Sales Orders are both subtypes of a Transaction. When using the Records Browser, you need to make sure you're using the "Search Filters" and "Search Columns" lists, not the Record's "Fields" list
You determine that by scrolling down to the "Search Data" section of either a Sales Order or Customer Deposit looking for "Search Filters" and "Search Columns" but seeing a link to the
Transaction
page instead
k
excellent, thank you
though... if they're both the same kind of thing, why do they behave differently? šŸ¤”
i guess because "entity" is not a join but "customer" is?
šŸ‘ 1
and the meaning of "entity" in a transaction would be contextual, but the meaning of "customer" is at least unambiguous?
e
They don't behave differently - at least not in Searches. For all Transactions,
entity
is the field ID for the Business Entity the Transaction is directed to. So whether you want to search for Purchase Orders by Vendor or Sales Orders by Customer or Customer Deposits by Customer,
entity
is the field you want:
I suppose you can think of
entity
as abstracting the JOIN to the Customer table or the Vendor table or the Partner table, although that's not quite what's happening technically
k
right, that's approximately what i'm thinking of. when i said "behave differently", i'm referring to the comment in the OP, where the "type" of the field is the same, but one wants to be joined and the other doesn't
maybe a clearer way to say it is - they behave self-consistently, but "entity" does not behave the same as "customer"
e
Right, because not all Transactions have a Customer, but all Transactions have an Entity