| ... | ... | @@ -199,6 +199,7 @@ The IDs necessary here are die "id" attributes in core.customer. |
|
|
|
### List Clients
|
|
|
|
|
|
|
|
To list all companies a client is assigned to - get those entries from core.customers which are assigned to the client (5 = system.client.id = core.customer.owning_client) and which are labeled as companies (is_client = false).
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
| ... | ... | @@ -213,6 +214,25 @@ To list all companies a client is assigned to - get those entries from core.cust |
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Or using the core.customer.id of the client - join the customer entry for this assigned_client:
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
#!json
|
|
|
|
|
|
|
|
|
|
|
|
# POST {{url}}/data/core/customer/query
|
|
|
|
{
|
|
|
|
"conds": {
|
|
|
|
"core__customer__owning_client.id" : 34,
|
|
|
|
"me.is_client" : false
|
|
|
|
},
|
|
|
|
"attrs" : {"join":{"assignment__core_customer__binding_instance_of_customer" : {"assigned_client" : "core__customer__owning_client"}}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### List Company Clients
|
|
|
|
|
|
|
|
To list all clients assigned to a company, join system.client via owning_client and onto that assignment.core_customer, filtering on the customer there.
|
| ... | ... | |