Hi all
When I go to create contact. It is showing me this error:
I enable trace. trace giving me following errors
at EntityMetadataNotFoundException..ctor(String entityName, NameMappingType mapping) ilOffset = 0x1B
at DynamicMetadataCache.GetEntity(String entityName, NameMappingType mapping) ilOffset = 0x13
at User.HasPrivilege(String entityName, PrivilegeType privilegeType, PrivilegeDepth privilegeDepth, Boolean filterOfflinePrivileges, IOrganizationContext context) ilOffset = 0x0
at DisplayRuleEvaluator.EvaluatePrivilegeRulePart(PrivilegeRulePart rulePart, String primaryEntity, String currentEntity) ilOffset = 0x63
at DisplayRuleEvaluator.EvaluateRulePart(RulePart rulePart, String primaryEntity, RibbonTabInformation tabInfo, DisplayRuleInformation displayRuleInformation) ilOffset = 0x195
at DisplayRuleEvaluator.EvaluateRule(String primaryEntity, RibbonTabInformation tabInfo, DisplayRuleInformation trimRuleInformation) ilOffset = 0x4C
at RibbonDisplayRuleEvaluator.GetHiddenControls(Dictionary`2 controlMap, Dictionary`2 ruleDefinitions, String primaryEntity, DisplayRuleInformation trimRuleInformation, HashSet`1 webHiddenControls, HashSet`1 offlineHiddenControls, HashSet`1 onlineHiddenControls) ilOffset = 0x56
at RibbonDisplayRuleEvaluator.GetHiddenIds(HashSet`1 displayRuleIds, Dictionary`2 mapCommandToRule, RibbonTabInformation tabInformation, DisplayRuleInformation displayRuleInformation, HashSet`1 webHiddenControls, HashSet`1 offlineHiddenControls, HashSet`1 onlineHiddenControls, Dictionary`2 dynamicCommandDefinitions, Dictionary`2 dynamicCommandToControlMap, IOrganizationContext context) ilOffset = 0x52
at RibbonDescription.CalculateHiddenControls(DynamicMenuInformation dynamicMenuInformation, HashSet`1 currentTabCommands, RibbonTabInformation tabInformation, String entityLogicalName) ilOffset = 0x1C9
at RibbonDescription.AddCommandsForTab(String tabIdForFetch, String entityLogicalName, RibbonTabInformation tabInformation) ilOffset = 0xF0
at RibbonDescription.AddCommandsForTab(RibbonTabInformation tabStruct) ilOffset = 0x0
at RibbonDescription.AddTabs() ilOffset = 0x99
at RibbonDescription..ctor(RibbonPageContext pageContext, IOrganizationContext context, Boolean excludeTabs) ilOffset = 0x77
at RibbonData.GetRibbonDescription(PageResourceManager currentHeader, Boolean suppressTabs) ilOffset = 0x4B
at RibbonData.CreateClientControl(PageResourceManager currentHeader, Boolean suppressTabs) ilOffset = 0x2F
at AppHeader.ConfigureRibbonDataControl() ilOffset = 0x5B
at AppHeader.Render(HtmlTextWriter output) ilOffset = 0x6
at Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) ilOffset = 0x22
at Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) ilOffset = 0x51
at Page.Render(HtmlTextWriter writer) ilOffset = 0xE
at Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) ilOffset = 0x22
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x8A4
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x38
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x187
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0xF6
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0x15B
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr) ilOffset = 0x32
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x4B
Crm Exception: Message: The entity with a name = 'Contact' was not found in the MetadataCache., ErrorCode: -2147217150
What is wrong? Please help me.
Thank You
*This post is locked for comments
Hi Abdul,
I would try below steps one at a time to troubleshoot this kind of issues.
1. Restart the CRM Server
2. Then check if the services are running on the server.
3. Turn off all plugins and workflows and then try creating the Contact again.
4. If it works, then turn on one at a time or in batches until it starts to fail again to find the plugin or workflow with an issue.
5. Check if the service accounts passwords has been reset or the accounts have been disabled.
6. Examine, Event Viewer logs and trace logs.
Cheers,
Nadeeja
Hi,
Have you made any customizations to the contact entity? Also please retrieve the entity metadata and check if contact entity exists there. Please try the following code for retrieving entity metadata.
public static EntityMetadata[] GetEntities ( IOrganizationService organizationService) { Dictionary<string, string> attributesData = new Dictionary<string, string>(); RetrieveAllEntitiesRequest metaDataRequest = new RetrieveAllEntitiesRequest(); RetrieveAllEntitiesResponse metaDataResponse = new RetrieveAllEntitiesResponse(); metaDataRequest.EntityFilters = EntityFilters.Entity; // Execute the request. metaDataResponse = (RetrieveAllEntitiesResponse)organizationService.Execute(metaDataRequest); var entities = metaDataResponse.EntityMetadata; return entities; }
Hi Pawel Gradecki
I also tried this way
Thank You
Hi Abed Haniyah
No there is no custom workflow on contact entity. I create contact with the help of this code.
Entity contact = new Entity("contact");
contact["firstname"] = "Abdul";
contact["lastname"] = "Wahab";
Guid contactId = service.Create(contact);
This code still creating contacts but from crm I am unable to create contacts.
Thank You
No, you are resetting website not IIS. On the left click on the "Win-US9********" and then on the right pane you will have option to reset web server not web site
Hi Pawel Gradecki
I restart my IIS with the help of this way
Is it right?
Thank You
Could you share your custom workflow code?
I mean IIS on CRM server, not your local IIS
Hi Pawel Gradecki
I restart my IIS but no success.
Thank You
Hi Pawel Gradecki
I am creating contacts from visual studio in custom workflow and after creating contacts I have this issue. I think so. Did you mean I restart my IIS?
Thank You
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156