Community
Showing results for 
Search instead for 
Do you mean 
Reply

ODATA problem for getting list of opportunities: cant include both opportunity contacts with companies and emailaddresses AND customFields.

Highlighted
Copper Contributor
Posts: 199
Country: Netherlands

ODATA problem for getting list of opportunities: cant include both opportunity contacts with companies and emailaddresses AND customFields.

I'd like to get a list of opportunities, with contac information and customFields.

 

I already know that sadly we cannot expand/selcet customFields (or only expand).

But I also need the contact emailAddress and company fields.

 

If I do this:

/api/opportunities?$select=id,name,status&$expand=contacts,stage($expand=process)

 

I get the contact info with id, displayName, fullName, emailAddress and company.

 

But if i leave the whole select/expand off, because I need some of the customFields, i only get the fields id and displayName. No emailAddress, and Company!

 

Why?!? It should. It's intuitive and sensible that when no expand is given it returns everything, like it does with addresses and customFields.

 

This doesnt work either:

 

/api/opportunities?$expand=contacts

 

because it returns an error:

"message": "An error has occurred.",
"exceptionMessage": "Sequence contains no matching element",
"exceptionType": "System.InvalidOperationException",

Greetings,

ACT Certified Consultants
TendenZ
the Netherlands