Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Plug-in issue

Posted on by 680

Hi ,

We are facing some strange issue in the plug-in. We have developed the plug-in on custom entity to do some configuration based on  CRM entities. When we tried to the same i.e. tried to retrieve Entity meta data using RetrieveEntity request for Account/Contact then it throws below error.

Entity with name "account" does not exist in CRM.

Plug-in registered on Isolation mode. CRM is on-premise. 

Is anyone face same issue and solution for it.

Thanks!

Balasaheb

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Plug-in issue

    Hi,

    like what Arun suggested, dont use your custom error message, let system prompt the correct error message.

      catch (Exception ex)

              {

                  throw new InvalidPluginExecutionException(ex.Message);

              }

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Plug-in issue

    There’s an issue in the code but that’s not about Account entity not exists. As this error message is custom string you composed for any exception caught in try catch block.

    Write the actual exception message + inner exception if any. Or you can debug for more investigation.

  • Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Plug-in issue

    Have you did any unsupported stuff in Account entity.

    Please check that account entity is in your CRM or not.

  • Balasaheb Profile Picture
    Balasaheb 680 on at
    RE: Plug-in issue

    Hi,

    Thanks for your reply.

    Custom entity name is new_config

    Here the code that we used. The same code is working on all other CRM instance only one CRM instance gives error.  

    private RetrieveEntityResponse RetrieveEntity(string entityName, IOrganizationService service)

           {

               RetrieveEntityRequest entityRequest = null;

               RetrieveEntityResponse entityResponse = null;

               try

               {

                   //create request

                   entityRequest = new RetrieveEntityRequest();

                   //add filters for entity

                   entityRequest.EntityFilters = EntityFilters.All;

                   //add entity logical name to check

                   entityRequest.LogicalName = entityName;

                   //execute the request

                   entityResponse = (RetrieveEntityResponse)service.Execute(entityRequest);

               }

               catch (Exception)

               {

                   throw new InvalidPluginExecutionException(String.Concat("Entity with ",  entityName , " name doesn't exist in CRM."));

               }

               return entityResponse;

           }

  • Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Plug-in issue

    What is your custom entity name?

    It will be good if you share your code.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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