Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

SearchRequest in CRM plugin

Posted on by 160

Hi. I want to create a service activity for my resource man(services).I write some code for it and use search request. as seen below. but I don't know why "SearchResults" does not retrieve any records.

SearchRequest search = new SearchRequest
{
AppointmentRequest = appointmentReq
};
SearchResponse searched = (SearchResponse) ServiceProxy.Execute(search);

AppointmentProposal _best_app_proposal = null;

if (searched.SearchResults.Proposals.Length > 0)
{
foreach (AppointmentProposal _app_proposal in searched.SearchResults.Proposals)
{
if (_app_proposal.Start.Value >=
new DateTime(_app_proposal.Start.Value.Year, _app_proposal.Start.Value.Month,
_app_proposal.Start.Value.Day, _AnchorOffset/60,
_AnchorOffset%60, 0).ToUniversalTime())
{
_best_app_proposal = _app_proposal;

break;
}
}

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: SearchRequest in CRM plugin

    Hi,

    Could you please provide appointmentReq object code snippet.

    Have you verified the records in Dynamics CRM using Advanced find?

    Check the dates of an appointment. It might be the date timezone issue and because of that it is not giving you any result.

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Suggested answer
    Pradeep Rai Profile Picture
    Pradeep Rai 5,490 Super User 2024 Season 2 on at
    RE: SearchRequest in CRM plugin

    HI,

    Please check below link and i tried with same code provided under the link. It worked for me.

    https://docs.microsoft.com/en-us/dotnet/api/microsoft.crm.sdk.messages.searchrequest?view=dynamics-general-ce-9

    Thanks,
    Pradeep

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans