Posts

Showing posts from November, 2014

CRM Related SQL Queries 1

SQL Queries Version 1 Get Privilege by Role name select priv.*  from Privilege priv join RolePrivileges rolePrivileges on (rolePrivileges.PrivilegeId = priv.PrivilegeId ) join Role role on (rolePrivileges.RoleId = role.RoleId) where role.Name = 'system administrator'  Get the Users By RoleName select sysuser.FirstName,sysuser.DomainName,sysuser.AccessMode, sysuser.ActiveDirectoryGuid,sysuser.CALType, sysuser.* from SystemUser sysuser join SystemUserRoles userRoles on (userRoles.SystemUserId = sysuser.SystemUserId ) join Role role on (userRoles.RoleId = role.RoleId ) where role.Name ='system administrator'  and sysuser.AccessMode=0 and sysuser.CALType=0 and sysuser.IsDisabled=0 Get All Privilege By Role with formatting SELECT DISTINCT FilteredRole.name, EntityView.PhysicalName AS [Entity Name], EntityView.IsCustomEntity AS [IsCustom], displayname.Label as[Entity Display Name] , CASE Privilege.AccessRight WHEN 1 T...

What is Difference between Retrieve VS Retrieverequest in SDK - use Retrieverequest to get related records using single server call

Image
Which method will you apply to get related records of an entity record?  Could we get it using service.retrieve? Probably you cannot... It will return single record but you may not get related records. So how do you get it  You can utilize Retrieverequest for this purpose. You can pass Relatedentity query as part of retrieve request which will return related entities as part of the response.  Let us see some sample if you want one specific incident record with its notes you can get it in a single server call. Retrieve Method Retrieve method used to get specific record by Id C# public override Entity Retrieve (             string entityName,             Guid id,             ColumnSet columnSet ) Parameters entityName Type:  Str...