Tuesday, 17 November 2015

Modify the Columns Shown in The Inline Lookup-CRM 2013 & 2015

A post to explain how to modify the columns shown in the inline lookup in CRM 2013 Refreshed Entity User Interface and what can be done and what cannot be done.

image

In the example (lookup to Contact), it shows only Name, Company Name, and Email Address.

You found that Email Address is not important, you want to show Name, City, and Company Name.

Explanation:

1. Go to Form Editor

2. Go to the field and check the lookup that is used, in this case is Contact view (lookup view) and get the Default View of the Lookup field

image

*You can also use custom view as default view.

image

3. Go to the Contact Lookup View and then you add can re-order the position

Previously:

image

Change to:

image

*You cannot modify the Full Name position nor remove it.

4. Test the Result:

image

*The supported total column shown in the inline lookup is 3 only (including Name as the primary field that is not replaceable)

It shows Name, City, and Company Name as per your expectation.

5. You can also use a Composite field, for example, Address

image

Result:

image

And you can get the tooltip.

image

6. But, you cannot use to show field from related entity.

Example:

image

Order: Name, City, Industry of the Account, Company Name

Result:

image

You should ‘Look Up More Records’

image

Friday, 6 November 2015

Finding nth highest & lowest salary example and explanation

Finding the nth highest &lowest salary in SQL have lots of query over the google,but i found good explanation here.

   
SELECT * /*This is the outer query part */
FROM Employee Emp1
WHERE (N-1) = ( /* Subquery starts here */
SELECT COUNT(DISTINCT(Emp2.Salary))
FROM Employee Emp2
WHERE Emp2.Salary > Emp1.Salary)

1. How to find 2nd highest or 3rd highest salary of an employee. 
   I am providing you a genral query to pick the nth highest salary from emp table it is not database specific query.
    select salary from emp e1 where (n-1)=(select count(*)  from emp where salary > e1.salary );

2.  You can also pick nth lowest salary of an employee.
     select salary from emp e1 where (n-1)=(select count(*)  from emp where salary < e1.salary ) ;



How does the query above work?

The query above can be quite confusing if you have not seen anything like it before – pay special attention to the fact that “Emp1″ appears in both the subquery (also known as an inner query) and the “outer” query. The outer query is just the part of the query that is not the subquery/inner query – both parts of the query are clearly labeled in the comments.

Understanding and visualizing how the query above works

Let’s assume that we are using this data:
Employee
Employee IDSalary
3200
4800
7450

3rd highest salary:

select * from Employeee as e1 where (N-1) =(select count(disticnt(e1.salary)
from emplyee as e2 where e2.salary>e1.salary)


select * from Employeee as e1 where (2) =(select count(disticnt(e1.salary)
from emplyee as e2 where e2.salary>200) 

Result:
2=3


select * from Employeee as e1 where (2) =(select count(disticnt(e1.salary)
from emplyee as e2 where e2.salary>800) 

Result:
2=1


select * from Employeee as e1 where (2) =(select count(disticnt(e1.salary)
from emplyee as e2 where e2.salary>450) 

Result:
2=2
Result is true so our o/p successfully got

O/p
450

Tuesday, 3 November 2015

Plugin Assembly Table in MSCRM

One of my colleagues faced a situation where he had installed a plugin assembly into database but was not able to locate its DLL, and now he wanted to deploy it in some other server.

In MSCRM all plugins related information like its name, content, createdBy, createdOn. ModifiedBy, ModifiedOn etc store in PluginAssemblybase Table. You can get it by below Query result :
select * from PluginAssemblyBase
Below are some column description of PluginBaseTable :

Column Name
Description
Name
Store name of Plugin
Source Type     
Where the Plugin registered
       0 -      Database
       1 -      Disk
       2 -      GAC
content
Store content of DLL

These are the steps to get DLL from Content :

Get the encoded base 64 string representation of the plugin from PluginAssemblyBase table.

select name,content,*
from PluginAssemblyBase

Use that content and get the dll from the following site.


Set decode and export to binary file option there with filename having extension as .dll

Open the dll in the reflector tool and use the source code to build that assembly.

Entities Overview – Microsoft Dynamics CRM

Overview of Entity in MSCRM



Entities form a vital piece of the Microsoft Dynamics CRM framework. Essentially, entities are used to model and manage business data. Some common entities that most Dynamics CRM users are familiar with are Account, Case, Campaign, Contact, Lead, and Opportunity. These entities deal with many of the most common sales, service, and marketing data with which a CRM user frequently engages.


Types of Enity in MSCRM


There are three main types of entities: system, business, and custom. In Dynamics CRM, system entities handle internal processes such as workflows. It is important to note that system entities cannot be deleted or customized. Business entities are the default entities within Dynamics CRM which include Case, Account, and Opportunity. One of the most important elements in Microsoft Dynamics CRM is customization. Custom entities provide organizations with a way to meet their needs head-on. One example of this is that you can create a vendor entity if you are a retail business and then dictate how it relates to different entities within your organization. Since each entity supports a variety of actions, streamlining communications processes among est your organization is now an attainable goal.



Entities Ownership – Microsoft Dynamics CRM

Ownership is a key factor in how entities work. In Microsoft Dynamics CRM, most entities have an owner, which is determined by the ownership type. There are four ownership types in CRM: organization, business, user, and none. Organization-owned entities can be accessed by an entire organization. These records cannot be assigned to an individual owner (or shared). Business-owned entities belong to a Business Unit, while user-owned entities are owned by one specific CRM user and typically contain customer-related data. Accounts, Contacts, and Cases are examples of user-owned entities. A few entities in Dynamics CRM have no ownership type. They are not owned by another entity (user, business unit, or organization) within CRM.
The following table lists the complete ownership types:
Ownership TypeDescription
Organization OwnedOrganization-owned entities typically contain data involving something that belongs to or that can be viewed by the whole organization. Organization-owned entities cannot be assigned or shared. For example, products are owned by the organization.
Business OwnedBusiness-owned entities belong to a business unit.
User OwnedUser-owned entities are associated with a user. User-owned entities typically contain data that relates to customers, such as accounts or contacts. Security can be defined according the business unit for the user.
NoneThe entity is not owned by another entity. For example, the uom (unit-of-measure) and workflowlog (workflow log) entities are not owned by another entity.

Difference between Asynchronous Plugin and Workflows in MSCRM


So many times I have been asked a question from my colleagues, 
What is the difference between Async Plugin and Workflow, Since both are Asynchronous But What is the actual difference between them and When should i use Workflow and When should I use Async Plugin ?

Answer :
My Answer is always "Depends", the right approach is determined by the Characteristics of the task that you are trying to accomplish.


 Following Matrix show the difference between the same :



          Requirement

Use Plug-in

Use Workflow

Needs a synchronous action to happen before or after an event occurs
Or
Need to perform a task that has to completed within 2 Sec




Yes


              No

 The logic needs to be executed while offline

Yes

No
Needs elevation of privileges (impersonation)
Or
Perform data operations on behalf of another system user



Yes


No
Needs to execute on events other than assign, create, update, set state

Yes

No
The process/logic may take a long time to complete or will be a persistent process (multiple long running steps)

No

Yes

End users will need to modify the process logic

            No

Yes
                                         Child sub processes will be triggered

No

Yes

Use of String Map Table in MSCRM

Ever wonder how (or where) CRM stores the related values for pick lists or Option set ?

Answer is in String Map Table


So what is string map table actually means in CRM?
String map table basically used in MSCRM for storing the details of Option Set Fields exists in an organization. It contains all the data (Attribute Name, Option Set name, option value , option name, Object Type Code) of option set.

Let’s take one requirement to clear the use of StringMap table, requirement is like:
 “Show the incident by status Name”
like: "CAS-T4R4F-U7Y6T5" shown status as "Problem Solved"
So in this scenario if we will have no string map table then either you need records which contain all the distinct type of record by status or you need hard code value use in report query.
By String Map table you can join the table and can collect all the status present in incident and can collect records number by grouping of them.
So this type of many scenarios can be fulfill by this table

Result of Case with Status Without using Stringmap Table :

Query : select TicketNumber[TicketNumber],statuscode[Status] from incident



Result of Case with Status using Stringmap Table :
Query :
select INC.TicketNumber[Case ID],SMT.Value[Status Name], SMT.AttributeValue[Status Value]
from incident as INC inner join StringMapBase as SMT
on INC.StatusCode = SMT.AttributeValue
where SMT.AttributeName='statuscode' and SMT.ObjectTypeCode=112


Monday, 2 November 2015

Change execution order between synchronous workflow and synchronous Plugin

 How should is change execution order between synchronous workflow and Plugin?
   Ans:we have tool synchronous event order in ToolBox by using we can able to update Rank of workflow.


CRM  tool – Plugin and Workflow Synchronous events execution order editor

This tool is really only of interest to developers, although it does have some use as informational tool to other users but it’s primary use is to allow the CRM developer to see and easily change the order of synchronous plugins and workflows.  The real bonus is it show the order of worflows next to Plugins, so you can see the whole picture of what is happening on the trigger of a CRM message/event for a particular entity.

To use it you fire up the XRMToolbox
add a connection.  If you are using a CRM 2013 trial select Use Office 365 because I found that when I tried to using the Use CRM Online I couldn’t connect

Tool - Plugin execution count 1


















Once you have your connection done, you will then a see a list of all the great tools.  Today we are going to click on Synchronous events execution order editor.  Clicking this will open a new tab with the tool details. This is useful because it means you can open multiple tools at once



Tool - Plugin execution count 2


Not only is the tool useful for changing the rank but it’s also an easy and quick way to view what plugins you have running.  When you look at your current system you will notice there are a lot of activity feed plugins running



Resolving Dynamics 365 Contact Sync Issues in Outlook – ExchangeSyncIdMapping Overload Introduction Recently, our project encountered a ...