locked
Cannot find entity in Security Role RRS feed

  • Question

  • Hi All,

     

    The trace files on a CRM 2011 Organization (recently upgraded from 4.0) are showing that the users require the prvReadLead privilege. This is reasonably easy to understand; give the users Read permissions to the Lead entity.

     

    The problem we have is that the Lead entity does not exist in the Organization. By this is mean that it doesn't display in the list of entities under the default solution (or any solution) and it does not appear in the Core Records section (or any section) of the Security Roles form.

     

    I can see the dbo.LeadBase table in the database. I can find the prvReadLead privilege in the dbo.PrivilegeBase base table. I'm wondering if the Lead entity was renamed.

     

    Does anyone know of some SQL scripts I can run to see what an entity's display name is compared to its database table name?

    Does anyone know how privileges map to entities in the database?


    • Edited by Mark.Cherry Thursday, October 20, 2011 1:38 PM
    Thursday, October 20, 2011 1:37 PM

Answers

  • I think the following SQL query will get you what you want (the display name is in the LocalizedLabel table/view)

    select Label from LocalizedLabelAsIfPublishedLogicalView l
    join EntityAsIfPublishedLogicalView e
    on l.ObjectId = e.EntityId
    where e.LogicalName = 'lead'
    and l.ObjectColumnName = 'LocalizedName'
    
    

     

     


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk

     

    Thursday, October 20, 2011 3:09 PM
    Moderator

All replies

  • Lead entity is a system entity that comes along with CRM and cannot be deleted. In your case lead may have been renamed to Prospect or some such other user friendly name.

    it appears as core entities in the security role window.

    Please check your CRM.

    HTH

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    • Proposed as answer by Sam - Inogic Thursday, October 20, 2011 1:52 PM
    Thursday, October 20, 2011 1:52 PM
  • Hi Sam,

     

    Thanks for the info. I have double check CRM and it just isn't visible. If it can't be deleted then it must be hidden somehow.

     

    I should of thought of this before but I used SQL Profiler to look at the queries to the database when accessing an entity via the web client. This gave me a script that I modified to query the details of Lead entity:

     

    SELECT [EntityId] AS [entityid],
    	[EntityRowId] AS [entityrowid],
    	[Name] AS [name],
    	[ObjectTypeCode] AS [objecttypecode],
    	[PhysicalName] AS [physicalname],
    	[LogicalName] AS [logicalname],
    	[CollectionName] AS [collectionname],
    	[OriginalLocalizedName] AS [originallocalizedname],
    	[OriginalLocalizedCollectionName] AS [originallocalizedcollectionname],
    	[BaseTableName] AS [basetablename],
    	[LogicalCollectionName] AS [logicalcollectionname],
    	[IsIntersect] AS [isintersect],
    	[IsSecurityIntersect] AS [issecurityintersect],
    	[IsLookupTable] AS [islookuptable],
    	[EventMask] AS [eventmask],
    	[IsLogicalEntity] AS [islogicalentity],
    	[IsCollaboration] AS [iscollaboration],
    	[IsMultipleQueueEnabled] AS [ismultiplequeueenabled],
    	[AutoRouteToOwnerQueue] AS [autoroutetoownerqueue],
    	[IsConnectionsEnabled] AS [isconnectionsenabled],
    	[IconLargeName] AS [iconlargename],
    	[IconMediumName] AS [iconmediumname],
    	[IconSmallName] AS [iconsmallname],
    	[IsActivity] AS [isactivity],
    	[ActivityTypeMask] AS [activitytypemask],
    	[AddressTableName] AS [addresstablename],
    	[IsDuplicateCheckSupported] AS [isduplicatechecksupported],
    	[IsDocumentManagementEnabled] AS [isdocumentmanagementenabled],
    	[OwnershipTypeMask] AS [ownershiptypemask],
    	[MobileAccessLevelMask] AS [mobileaccesslevelmask],
    	[IsVisibleInMobile] AS [isvisibleinmobile],
    	[IsAudited] AS [isaudited],
    	[IsAuditEnabled] AS [isauditenabled],
    	[UsesFullnameConventionRules] AS [usesfullnameconventionrules],
    	[IsParented] AS [isparented],
    	[EntityMask] AS [entitymask],
    	[IsReplicated] AS [isreplicated],
    	[IsReplicationUserFiltered] AS [isreplicationuserfiltered],
    	[IsChildEntity] AS [ischildentity],
    	[IsCustomEntity] AS [iscustomentity],
    	[IsActivityParty] AS [isactivityparty],
    	[IsEnabledForCharts] AS [isenabledforcharts],
    	[IsValidForAdvancedFind] AS [isvalidforadvancedfind],
    	[ExtensionTableName] AS [extensiontablename],
    	[ReportViewName] AS [reportviewname],
    	[IsRequiredOffline] AS [isrequiredoffline],
    	[IsShareableAcrossOrgs] AS [isshareableacrossorgs],
    	[IsSolutionAware] AS [issolutionaware],
    	[CanTriggerWorkflow] AS [cantriggerworkflow],
    	[WorkflowSupport] AS [workflowsupport],
    	[IsPublishable] AS [ispublishable],
    	[CanBeInCustomEntityAssociation] AS [canbeincustomentityassociation],
    	[CanBeInCustomReflexiveRelationship] AS [canbeincustomreflexiverelationship],
    	[EntityClassName] AS [entityclassname],
    	[ServiceClassName] AS [serviceclassname],
    	[EntityAssembly] AS [entityassembly],
    	[ServiceAssembly] AS [serviceassembly],
    	[NextCustomAttributeColumnNumber] AS [nextcustomattributecolumnnumber],
    	[IsImportable] AS [isimportable],
    	[IsMailMergeEnabled] AS [ismailmergeenabled],
    	[RecurrenceBaseEntityId] AS [recurrencebaseentityid],
    	[InheritsFrom] AS [inheritsfrom],
    	[IsInheritedFrom] AS [isinheritedfrom],
    	[CanBeSecured] AS [canbesecured],
    	[ParentComponentType] AS [parentcomponenttype],
    	[ParentControllingAttributeName] AS [parentcontrollingattributename],
    	[IsManaged] AS [ismanaged],
    	[IsMapiGridEnabled] AS [ismapigridenabled],
    	[IsReadingPaneEnabled] AS [isreadingpaneenabled],
    	[SolutionId] AS [solutionid],
    	[OverwriteTime] AS [overwritetime],
    	[SupportingSolutionId] AS [supportingsolutionid],
    	[CanBeChildInCustomRelationship] AS [canbechildincustomrelationship],
    	[IsCustomizable] AS [iscustomizable],
    	[IsRenameable] AS [isrenameable],
    	[IsMappable] AS [ismappable],
    	[CanModifyAdditionalSettings] AS [canmodifyadditionalsettings],
    	[CanModifyAuditSettings] AS [canmodifyauditsettings],
    	[CanModifyMobileVisibility] AS [canmodifymobilevisibility],
    	[CanModifyConnectionSettings] AS [canmodifyconnectionsettings],
    	[CanModifyDuplicateDetectionSettings] AS [canmodifyduplicatedetectionsettings],
    	[CanModifyMailMergeSettings] AS [canmodifymailmergesettings],
    	[CanModifyQueueSettings] AS [canmodifyqueuesettings],
    	[CanCreateAttributes] AS [cancreateattributes],
    	[CanBeRelatedEntityInRelationship] AS [canberelatedentityinrelationship],
    	[CanBePrimaryEntityInRelationship] AS [canbeprimaryentityinrelationship],
    	[CanBeInManyToMany] AS [canbeinmanytomany],
    	[CanCreateForms] AS [cancreateforms],
    	[CanCreateCharts] AS [cancreatecharts],
    	[CanCreateViews] AS [cancreateviews] FROM [EntityAsIfPublishedView] 
    WHERE BaseTableName = 'LeadBase'
    
    


    The results were:

     

    name: lead

    physicalname: Lead

    logicalname: lead

    collectionname: Leads

    originallocalizedname: Lead

    originallocalizedcollectionname: Leads

    basetablename: LeadBase

    logicalcollectionname: leads

    ...

     

    It doesn't look like the entity was renamed. Any other ideas?

     

     

    Thursday, October 20, 2011 2:05 PM
  • when you open the security role in the sales area section what entities are listed? do you see account, contact etc. in that list what other entities are listed? can you post a screenshot of security role screen?

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, October 20, 2011 2:13 PM
  • Please see the picture:

     

    Thursday, October 20, 2011 2:21 PM
  • and in the core records section?

    Sam


    Web: http://www.inogic.com
    Blog: http://inogic.blogspot.com
    Email: news@inogic.com
    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, October 20, 2011 2:34 PM
  •  

    (I've got to go and help a user for a while - thanks for your help so far Sam)

    Thursday, October 20, 2011 2:43 PM
  • I think the following SQL query will get you what you want (the display name is in the LocalizedLabel table/view)

    select Label from LocalizedLabelAsIfPublishedLogicalView l
    join EntityAsIfPublishedLogicalView e
    on l.ObjectId = e.EntityId
    where e.LogicalName = 'lead'
    and l.ObjectColumnName = 'LocalizedName'
    
    

     

     


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk

     

    Thursday, October 20, 2011 3:09 PM
    Moderator
  • Thanks David,

     

    That is exactly what I wanted. Lead had been renamed to Prospect.

     

    Just to clarify what was found for future readers:

    • Default system entities cannot be deleted
    • When you rename a default system entity the privilege names stay the same (i.e. prvReadLead)
    • When you rename a default system entity the database table name stays the same (i.e. dbo.LeadBase)
    • Use David's SQL script above to find the current name of default system entities
    • Edited by Mark.Cherry Thursday, October 20, 2011 3:42 PM
    Thursday, October 20, 2011 3:35 PM