web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

msdyn_SearchResourceAvailability implement in plugin

(0) ShareShare
ReportReport
Posted on by 5

I am trying to find resource availability based on Characterstics, Category and organizational unit using plugin. Is there way to call action msdyn_SearchResourceAvailability using Plugin. 

I have the same question (0)
  • Aashish Baral51 Profile Picture
    5 on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    Entity requirement = new Entity("msdyn_resourcerequirement");

                                               requirement["msdyn_fromdate"] = bookingDate;

                                               requirement["msdyn_todate"] = bookingDate.Add(TimeSpan.FromMinutes(Convert.ToDouble(estimatedDuration)));

                                               requirement["msdyn_effort"] = 1;

                                               requirement["msdyn_remainingduration"] = estimatedDuration;

                                               EntityCollection characterstics = new EntityCollection();

                                               characterstics.Entities.Add(new Entity("characteristic", preferredSkill.Id));

                                               EntityCollection category = new EntityCollection();

                                               category.Entities.Add(new Entity("bookableresourcecategory", preferredRole.Id));

                                               EntityCollection orgUnit = new EntityCollection();

                                               orgUnit.Entities.Add(new Entity("msdyn_organizationalunit", preferredOrganizationalUnit.Id));

                                               Entity resourcespecification = new Entity("organization");

                                               Entity constraints = new Entity("organization");

                                               constraints["Characteristics"] = characterstics;

                                               constraints["Roles"] = category;

                                               resourcespecification["Constraints"] = constraints;

                                               Entity settings = new Entity("organization");

                                               settings.Attributes.Add("ConsiderSlotsWithProposedBookings", true);

                                               settings.Attributes.Add("ConsiderSlotsWithLessThanRequiredCapacity", false);

                                               OrganizationRequest reqAction = new OrganizationRequest("msdyn_SearchResourceAvailability");

                                               reqAction["Version"] = "1";

                                               reqAction["Requirement"] = requirement;

                                               reqAction["Settings"] = settings;

                                               reqAction["ResourceSpecification"] = resourcespecification;

                                               //execute the request

                                               OrganizationResponse response = service.Execute(reqAction);

  • eromerof Profile Picture
    104 on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    I just achieve it!!. Here I leave the code:

    OrganizationRequest req = new OrganizationRequest("msdyn_SearchResourceAvailability");
                    req["Version"] = "1";
                    req["Requirement"] = new Entity("msdyn_resourcerequirement", new Guid("1181fb75-c732-ea11-a813-000d3ab29c25"));
                    var SettingsEntity = new Entity("organization");
                    SettingsEntity["ConsiderSlotsWithProposedBookings"] = true;
                    SettingsEntity["ConsiderSlotsWithProposedBookings"] = true;
                    req["Settings"] = SettingsEntity;
                    var response = service.Execute(req);

  • eromerof Profile Picture
    104 on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    Hi,

    Please, can you share the c# code (or a sample request) to call this action?  I'm not be able to build the request

    Thank you so much!

  • erhan.keskin Profile Picture
    on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    Is it just in the plugin you see 0 total available time?

    How is it seen in the resource scheduling?

    community.dynamics.com/.../how-to-sort-results-by-total-available-time-when-searching-for-resource-availability

    cloudblogs.microsoft.com/.../

  • Aashish Baral51 Profile Picture
    5 on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    Hi Erhan Keskin,

    Thanks for your reply,

    I have developed plugin based on the blogs links that you have added. I am able to retrieve resource based on constraints that I have set but the resource totalAvailableTime is returned as 0. I have looked into the retrieved resource bookings but there is no booking records against those resources in that specific date.

    Thanks

    Aashish

  • erhan.keskin Profile Picture
    on at
    RE: msdyn_SearchResourceAvailability implement in plugin

    Hi,

    Is this what you are looking for?

    How to use resource scheduling search resource availability: https://cloudblogs.microsoft.com/dynamics365/it/2019/07/15/how-to-use-resource-schedulings-search-resource-availability-api/

    Retrieve resource availability with universal resource scheduling api: https://cloudblogs.microsoft.com/dynamics365/it/2019/05/21/retrieve-resource-availability-with-universal-resource-scheduling-api/

    Regards,

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

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 576

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 351 Super User 2025 Season 2

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 237 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans