Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

C# Plugin Question - Custom Entity not found

Posted on by 575

Hi. I have been using the Microsoft tutorials to understand plugins and (ex HttpResponseMessage & HttpClient).

The Task below works fine when my query parameter is either the "contacts" or "accounts" entities. I created a custom entity - "Automobile" which I am able to perform CRUD operations, create processes etc. from the CRM application, however, when I try to run the plugin below where the query is now "Automobiles" I am getting a 404 - Not found error. I don't know why my custom entity cannot be found. Any ideas why?

private async Task<HttpResponseMessage> SendCrmRequestAsync(HttpMethod method, string query, Boolean formatted = false, int maxPageSize = 10)

{

HttpRequestMessage request = new HttpRequestMessage(method, query);

request.Headers.Add("Prefer", "odata.maxpagesize=" + maxPageSize.ToString());

if (formatted)

request.Headers.Add("Prefer","odata.include-annotations=OData.Community.Display.V1.FormattedValue");

return await httpClient.SendAsync(request);

}

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: C# Plugin Question - Custom Entity not found

    Hi Steve

    I know a plugin that can help log calls automatically in MS Dynamics. That app is Tenfold, a CTI and sales acceleration platform that offers features like call logging and call monitoring. You can check out Tenfold on the integrations page if you'd like to know more. www.tenfold.com/.../dynamics

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: C# Plugin Question - Custom Entity not found

    Ok, while working with OData, you need to use schema name of the entity.

  • Suggested answer
    Alagunellaikumar Profile Picture
    Alagunellaikumar 6,210 on at
    RE: C# Plugin Question - Custom Entity not found

    Hi

    You have to use schema name

  • SteveWhyte Profile Picture
    SteveWhyte 575 on at
    RE: C# Plugin Question - Custom Entity not found

    HIMBAP,

    Thanks for your response. I just found out the issue but it's still strange. I printed my schema and found out that my automobile entity had the plural name "new_automobiles" saved as the url. I understand that this should reflect the plural name. My plural name however is simply "Automobiles".

    Anyway, I used "new_automobiles" in my code and the entity was found....but this is very strange.

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: C# Plugin Question - Custom Entity not found

    What entity name you are using in your code, could you share complete code here for inquiry??

  • prt33k Profile Picture
    prt33k 6,907 on at
    RE: C# Plugin Question - Custom Entity not found

    can you post you query string as well.

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans