on 2023 Jul 17 5:52 PM
Dear Experts,
Firstly I would like to inform that we have multiple contact persons for the Business partner (Customer) and we are using third party system for Customer Queries and now we would like to store the Internalcode of ContactEmployees back to the third party system and to do so.
We are trying to filter the Contact Employees of Business partner using the custom user defined field (U_cID) created in Contact employees however getting the below error.
Kindly guide me on the filtering aspect
ankit.chauhan1
wenli.chen
andy.bai
Payload:
https://myserver:50000/b1s/v1/BusinessPartners('C-01849124')/ContactEmployees?$filter=U_C4CContactID eq '104278'
{ "error": { "code": -1000, "message": { "lang": "en-us", "value": "Property 'U_C4CContactID' of 'BusinessPartner'is invalid" } }}
Request clarification before answering.
Hi @kyuvi0786 ,
Please use the crossjoin function:
/b1s/v1/$crossjoin(BusinessPartners,BusinessPartners/ContactEmployees)?$expand=BusinessPartners($select=CardCode,CardName),BusinessPartners/ContactEmployees($select=CardCode,Name)&$filter=BusinessPartners/CardCode eq BusinessPartners/ContactEmployees/CardCode and BusinessPartners/CardCode eq '1037' and BusinessPartners/ContactEmployees/Name eq 'Paul'
Here, you need to replace '1037' with your BusinessPartner code and Replace Name to your UDF field name and replace 'Paul' to your contact id.
The expected result like this:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{
"QueryPath": "$crossjoin(FixedAssets,FixedAssets/DepreciationLines)",
"QueryOption": "$expand=FixedAssets($select=DocEntry,DocNum,DocStatus,RefDate),FixedAssets/DepreciationLines($select=DocEntry,AssetCode,DepreciationAmount)&$filter=FixedAssets/DocEntry eq FixedAssets/DepreciationLines/DocEntry"
}
"value": "Invalid query objects."
Is ODRN/DRN2 the correct way to reference the line table in $crossjoin and $expand?
Or should I use something like DRN2 directly (if that’s a separate entity set)?
What is the correct $expand structure to include both ODRN and Depreciation Lines in one query?
Could you please confirm the valid entity set names for both header and lines?
I couldn’t find clear documentation showing whether DRN2 is an exposed collection or only accessible as a navigation property.
If $crossjoin doesn't support navigation like ODRN/DRN2, what is the recommended pattern to retrieve header and line data in a single query?
| User | Count |
|---|---|
| 33 | |
| 18 | |
| 14 | |
| 13 | |
| 9 | |
| 4 | |
| 3 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.