Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics 365 Search Resource Availability With Constraints

Posted on by 5

I've been trying to add filters to my Search Resource Availability api call following this page: [Search resource availability API][1]
No matter what I do I can't seem to filter by Organizational Unit.
Here's my http call body:
```json
{
"Version": "3",
"IsWebApi": true,
"Requirement": {
"msdyn_fromdate": "2021-11-01T00:00:00Z",
"msdyn_todate": "2021-11-30T23:59:00Z",
"msdyn_remainingduration": 60,
"msdyn_duration": 60,
"@odata.type": "Microsoft.Dynamics.CRM.msdyn_resourcerequirement"
},
"Settings": {
"ConsiderSlotsWithProposedBookings": false,
"MovePastStartDateToCurrentDate": true,
"@odata.type": "Microsoft.Dynamics.CRM.expando"
},
"ResourceSpecification":{
"@odata.type": "Microsoft.Dynamics.CRM.expando",
"ResourceTypes@odata.type": "Collection(Microsoft.Dynamics.CRM.expando)",
"ResourceTypes": [
{
"@odata.type": "Microsoft.Dynamics.CRM.expando",
"value": "3"
}
],
"Constraints": {
"@odata.type": "Microsoft.Dynamics.CRM.expando",
"OrganizationalUnits@odata.type": "Collection(Microsoft.Dynamics.CRM.expando)",
"OrganizationalUnits":[
{
"@odata.type": "Microsoft.Dynamics.CRM.expando",
"value": "b2054232-a114-ec11-b6e7-000d3a842ab8"
}
]
}
}
}
```

And here's the response I get:
```json
{
"@odata.context": "">orga215da53.api.crm3.dynamics.com/.../$metadata
"TimeSlots": [],
"Resources": [],
"Related": {
"@odata.type": "#Microsoft.Dynamics.CRM.expando",
"TimeSlots@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
"TimeSlots": [],
"Resources@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
"Resources": []
},
"Exceptions": {
"@odata.type": "#Microsoft.Dynamics.CRM.expando"
}
}
```
But i KNOW that that organization unit exists in CRM.
I tried changing the odata.type to the actual Organization Unit CRM type (`msdyn_organizationalunit`) but that just gives me an error (`An error occurred while validating input parameters: System.ArgumentNullException: Value cannot be null`)
What is it that I'm doing wrong?
Thanks!

[1]: docs.microsoft.com/.../search-resource-availability-api

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans