Sunday, 20 September 2015

Dynamics CRM Interview Questions

Javascript
1.  Can we check if entity is dirty or field is dirty?
//To Check if the entity is dirtyvar ismodified=Xrm.Page.data.entity.getIsDirty();
//To Get Dirty Fieldsvar attributes = Xrm.Page.data.entity.attributes.get() ;
for (var i in attributes)
{
var attribute = attributes[i];
if (attribute.getIsDirty())
alert(“attribute dirty: ” + attribute.getName());
}

Customization & Configuration
2. Can Rollup fields be implemented for entities with N: N relationship?
A. No; A Rollup fields can be done only over related entities with the 1: N relationship. A Rollup can’t be done over the N: N relationships.

3. Can Hierarchy be implemented between two entities?
A. The visualization feature can only be enabled for self-referencing relationships within a particular entity, including custom entities. 

4. What is the default time period of auto-save in MS CRM 2013/2015 forms? 
A. 30 Sec

5. Can you disable auto-save for a particular entity form and if yes, how? 
A. We can disable auto-save for organization or for a particular entity form. 
For Organization
  • Go to Settings > Administration
  • Choose System Settings.
  • For the Enable auto-save for all forms option, select No.
For Particular Entity
It can be done through JavaScript. For more details refer to 
https://technet.microsoft.com/en-us/library/dn531073.aspx#BKMK_DisableAutoSaveOrg

Programming
6. What is the difference between Authentication and Authorization ?
A. Authentication is the process of verifying the identity of a user by obtaining some sort of credentials and using those credentials to verify the user's identity. If the credentials are valid, the authorization process starts. Authentication process always proceeds to Authorization process.
Authorization is the process of allowing an authenticated users to access the resources by checking whether the user has access rights to the system. Authorization helps you to control access rights by granting or denying specific permissions to an authenticated user.


Saturday, 5 September 2015

Query to find security roles of a user / team

Query to find security roles of all users

Select SU.fullname as [User Name] ,SU.businessunitidname as [BU Name] , SU.systemuserid as [User Guid],R.name as [User RollName]
From SystemUserRoles SUR Inner Join FilteredSystemUser SU
On SU.systemuserid  = SUR.SystemUserId Inner Join FilteredRole R
On R.roleid = SUR.RoleId

Order By SU.FullName

Query to find security roles of a particular user

Select SU.fullname as [User Name],SU.businessunitidname as [BU Name] ,SU.systemuserid as [User Guid],R.name as [User Role Name] From SystemUserRoles SUR Inner Join FilteredSystemUser SU
On SU.systemuserid  = SUR.SystemUserId Inner Join FilteredRole R
On R.roleid = SUR.RoleId

where SU.systemuserid =  '' (UserGuid)


Query to find teams of a particular user

Select SU.fullname as [User Name] ,SU.businessunitidname as [BU Name] ,T.name as [Team Name] From filteredteammembership TM Inner Join FilteredSystemUser SU On TM.systemuserid  = SU.SystemUserId Inner Join FilteredTeam T On T.teamid = TM.teamid where SU.systemuserid ='' (UserGuid)

Query to find teams of all users

Select SU.fullname as [User Name],SU.businessunitidname as [BU Name],T.name as [Team Name] From filteredteammembership TM Inner Join FilteredSystemUser SU On TM.systemuserid  = SU.SystemUserId Inner Join FilteredTeam T On T.teamid = TM.teamid Order By SU.FullName


Query to get Roles of the Team


Select * from FilteredTeamRoles


What is think and thin client

Repost from http://www.webopedia.com/DidYouKnow/Hardware_Software/thin_client.asp
In the world of client/server architecture, you need to determine if it will be the client or the server that handles the bulk of the workload. By client, we mean the application that runs on a personal computer or workstation and relies on a server to perform some operations.
Thick or thin client architecture is actually quite similar. In both cases, you can consider it as being the client application running on a PC whose function is to send and receive data over the network to the server program. The server would normally communicate that information to the middle-tier software (the backend), which retrieves and stores that information from a database.
While they share similarities, there are many differences between thick and thin clients. Thick and thin are the terms used to refer to the hardware (e.g., how a PC communicates with the server), but the terms are also used to describe applications. While this article deals specifically with hardware issues, be sure to check back as we will continue our Thick and Thin discussion as related to applications.

Thin Clients

thin client is designed to be especially small so that the bulk of the data processing occurs on the server. Although the term thin client often refers to software, it is increasingly used for the computers, such as network computers and Net PCs, that are designed to serve as the clients for client/server architectures. A thin client is a network computer without a hard disk drive. They act as a simple terminal to the server and require constant communication with the server as well.
Thin clients provide a desktop experience in environments where the end user has a well-defined and regular number of tasks for which the system is used. Thin clients can be found in medical offices, airline ticketing, schools, governments, manufacturing plants and even call centers. Along with being easy to install, thin clients also offer a lower total cost of ownership over thick clients.

Thick Clients 

In contrast, a thick client (also called a fat client) is one that will perform the bulk of the processing  in client/server applications. With thick clients, there is no need for continuous server communications as it is mainly communicating archival storage information to the server. As in the case of a thin client, the term is often used to refer to software, but again is also used to describe the networked computer itself. If your applications require multimedia components or that are bandwidth intensive, you'll also want to consider going with thick clients. One of the biggest advantages of thick clients rests in the nature of some operating systems and software being unable to run on thin clients. Thick clients can handle these as it has its own resources.
Key Terms To Understanding Storage Servers:
client
The client part of a client-server architecture. Typically, a client is an application that runs on a personal computer or workstation and relies on a server to perform some operations.
server
A computer or device on a network that manages network resources. Servers are often dedicated, meaning that they perform no other tasks besides their server tasks.
client/server architecture
A network architecture in which each computer or process on the network is either a client or a server.

Thick vs. Thin - A Quick Comparison

Thin Clients

Thick Clients

- Easy to deploy as they require no extra or specialized software installation
- Needs to validate with the server after data capture
- If the server goes down, data collection is halted as the client needs constant communication with the server
- Cannot be interfaced with other equipment (in plants or factory settings for example)
- Clients run only and exactly as specified by the server
- More downtime
-Portability in that all applications are on the server so any workstation can access
- Opportunity to use older, outdated PCs as clients
- Reduced security threat
- More expensive to deploy and more work for IT to deploy
- Data verified by client not server (immediate validation)
- Robust technology provides better uptime

 - Only needs intermittent communication with server

- More expensive to deploy and more work for IT to deploy
- Require more resources but less servers
- Can store local files and applications
- Reduced server demands
- Increased security issues






Wednesday, 20 August 2014

SQL Query to get all the Privileges of a all roles of MS-CRM 2013 system.

Today i came across a requirement from my customer to get all the Privileges of a particular user.Below is the query to get all privileges for all roles.

SELECT DISTINCT FilteredRole.name, EntityView.PhysicalName AS [Entity Name],
CASE Privilege.AccessRight WHEN 1 THEN 'READ' WHEN 2 THEN 'WRITE' WHEN 4 THEN 'APPEND'
WHEN 16 THEN 'APPENDTO' WHEN 32 THEN 'CREATE' WHEN 65536 THEN 'DELETE' WHEN 262144
THEN 'SHARE' WHEN 524288 THEN 'ASSIGN' END AS [Access Level], CASE PrivilegeDepthMask
WHEN 1 THEN 'User' WHEN 2 THEN 'Business Unit' WHEN 4 THEN 'Parent: Child Business Unit'
WHEN 8 THEN 'Organisation' END AS [Security Level] FROM RolePrivileges INNER JOIN
FilteredRole ON RolePrivileges.RoleId = FilteredRole.roleid INNER JOIN
PrivilegeObjectTypeCodes ON
RolePrivileges.PrivilegeId = PrivilegeObjectTypeCodes.PrivilegeId INNER JOIN Privilege ON
RolePrivileges.PrivilegeId = Privilege.PrivilegeId INNER JOIN EntityView ON
EntityView.ObjectTypeCode = PrivilegeObjectTypeCodes.ObjectTypeCode
ORDER BY FilteredRole.name, [Entity Name]


Thanks to CRM Hobbit's blog for his blog.

I need to modify this to further suit my requirement.

Cheers,
Rajesh