"тнιѕ вℓσg ¢συℓ∂ ѕανє уσυя мσηєу ιƒ тιмє = мσηєу" - ∂.мαηנαℓу

Monday, 25 January 2016

Whats new in CRM 2016

With reference to Microsoft Dynamcis CRM Help and Training website, there will be some cool features along with CRM 2016. 

Some interesting features are Preformatted templates for creating excel templates, Onedrive for business directly from CRM,  changing colour scheme using Themes, email folder tracking, Survey ( this is cool one ) . And we will be able to export up to 100000 records using excel export in Dynamics CRM 2016.

For further details please check the link below.

https://www.microsoft.com/en-us/dynamics/crm-customer-center/what-s-new.aspx



Sunday, 10 January 2016

Remote Desktop Connection Manager

Sometimes we might need to work in multiple Dynamics CRM projects at the same time. It may not be that easy to switch between servers of customers and progress our work. Also its not easy to remember the connection details, logins etc. I would recommend to use Remote Desktop connection manager to connect to various client servers. I got appreciation from my manager that I am well organized when he noticed that I use Remote Desktop connection manager for various servers. Well its a good time saver. Just imagine how long it takes to connect to each servers or finding connection details etc. Highly recommended when you need to handle multiple clients at the same time. The key point is its really easy to switch from one customer to another. And finally its a free tool from Microsoft.

Remote Desktop Connection Manager can be downloaded from the below link

https://www.microsoft.com/en-gb/download/details.aspx?id=44989


Its not a tough nut. You could easily play around and practice more. If you right click and select properties, you could configure logon credentials etc for each server. For instance, Customer 2 Dev represents server connection whereas Customer1 is a group.



Saturday, 12 December 2015

How to Extract Dynamics CRM Fields to an Excel Sheet

This post is about how to extract Dynamics CRM fields into a Microsoft Excel sheet.  We might need this info for data migration / integration tasks. For instance mapping of Dynamics CRM fields against an old system from which we need to migrate  / integrate data.

Xrm Tool box provides a tool with this feature. Download link is given below.

http://www.xrmtoolbox.com/download.html


1.After download, extract the zip file to a custom folder.


2.  Open the XrmToolBox.exe. Choose Metadata Document Generator


3. Next step is to connect to the organization. So click yes.


4. Create a new connection by clicking on the New Connection button.



5. Create the connection with your CRM server / Online version details.


6. Once connected, Xrm tool box loads all the entities. Now choose your entity or all entities as per your requirement.  Please note the highlighted buttons. Click on Generate document button after choosing the options.


7. Thats it really. You could find your excel document with chosen attributes in the chosen folder.

Thanks to Xrm Tool Box !


Sunday, 6 December 2015

Power Map

Power map is a 3-D visualization tool for Excel. Power map is based on Microsoft Bing maps. As the name implies its a powerful visualization map. Power map is more powerful when its used in conjunction with Power BI. Lets take a look.

Power map could detect the following data ( geolocation data)

• Latitude/Longitude (formatted as decimal)
• Street Address
• City
• County
• State / Province
• Zip Code / Postal Code

• Country/Region

Version used for this post:
Microsoft Office Professional Plus 2013
Power BI was activated from the office 365 login in order to utilize Power BI features.
Microsoft Excel -> File-> Options->Add-ins->Manage option set-> COM Add-ins->Go->Select Microsoft Power Map-> OK

"If you have a subscription for Microsoft Office 365 ProPlus, you have access to Power Map for Excel as part of the self-service business intelligence tools. Whenever any new Power Map features and performance enhancements are released, you'll get them as part of your subscription plan."
(Ref:https://support.office.com/en-us/Article/Power-Map-for-Excel-82d65bd7-70c9-48a3-8356-6b0e82472d74 )

We are considering 2 samples in order to understand power maps.

I)  Common scenario in Microsoft Dynamics CRM-  To plot the number of opportunities from certain area ( For instance Based on post code or City ). Its a simple scenario without using Power BI features.

II) Ref : https://eriksvensen.wordpress.com/2015/07/06/visualize-the-danish-mobile-network-history-coverage-using-powerquery-and-powermap-powerbi/

A sample mentioned in Erik Svensen's blog - Danish mobile network history and coverage. 

This sample is an amazing scenario.Full Credit: Erik Svensen with reference to his blog. Tak Erik Svensen !. This is a scenario using power BI features.

Scenario I: Plot the number of Opportunities based on the post code.

We have a table with postcodes ( UK  post code)  and number of opportunities in Excel as shown below.

1. Select the whole table first and then Insert tab-> Map-> Launch Power map





2. Create a new tour




3. Choose Geography and then Geography and map level as shown below. Select Zip against post code. And click next.




4. Drag the Number of Opportunities field to the Height as shown below.



5.  Use the tilt down / up , rotate right / left arrows. Also zoom in / out could be used to have better view.




6. Map label was one of favourites feature.




7. Heat map view. Heat map button is highlighted.





Scenario II

Ref : https://eriksvensen.wordpress.com/2015/07/06/visualize-the-danish-mobile-network-history-coverage-using-powerquery-and-powermap-powerbi/

A sample mentioned in Erik Svensen's blog - Danish mobile network history and coverage. 

This sample is an amazing scenario.Full Credit: Erik Svensen with reference to his blog. Tak Erik Svensen !. This is a scenario using power query- power BI features.

URL for Danish mobile network with reference to Erik's blog - http://mastedatabasen.dk/Master/antenner.json?maxantal=1000 ( In this sample we are selecting only 1000 records)

1. Power BI- Power Query is very useful for bringing data. Please note the tab Power query and the button from Web. Enter the provided url and press ok.



2. Records would be loaded as 'Record'. Click on the To Table button



3. Default values are ok in our case. Press ok



4. Next step is a bit tricky. Please note the highlighted tiny button.




5.  Lets learn Danish language : ) . We are not selecting all fields but only the necessary ones in this sample. Postnummer is post code. vejnavn is street name. Kommune is municipality. We could choose whichever fields we like. As i mentioned at the beginning Power map can detect certain data like post code ( see the full list at the beginning of this post)




6. Expand columns as shown below. Then you could  see the real data.



7. After expansion, you could see data like below. Once we have proper data, click on the close and load button.




8. Next step is to launch power map from the Insert tab. Then click new tour.




9. Select Column1.postnummer.nr  column and then select zip code against it as shown below. Click next.




10. For this sample height is not important. You could play around with it if you prefer. Its not chosen in the below picture.  You could use the tilt down / up , rotate right / left arrows. Also zoom in / out could be used to have better view.



11. Please note the buttons Capture screen ( once you click this button you could paste in paint or word etc just like screen shot, Create video etc. Here is a capture screen sample. Users could create video for presentations using the create video. Power map is very useful in Geomarketing.




Wednesday, 18 March 2015

JS Development in Dynamics CRM- Tips

    This post is regarding a javascript development tip which is very useful in Dyamics CRM. It was not my idea but my colleagues' (Irina and Alex). And it was an eye opener for me. As we all know we write js code on form load as well as on change event of different fields in Dynamics CRM. At a later point have you ever struggled to see on which fields we have js code ?  I have. Their suggestion was to use attach events by using the addonchange js function in Dynamics CRM. They also mentioned that this would make the js code more transparent. addonChange function is nothing but a js function to be called when the attribute changes. Please read the comments below. Thanks to Irina and Alex for this recommendation.


//Form Load
//onLoad function should be added to the Form load event of Form editor as usual
function onLoad() {

    FillData();// FillData Function call on Form load
    attachEvents();
}


//Function to attach events to different fields
function attachEvents() {

    //Attach Onchange event of lookup1(new_City) and lookup2(new_Profession)
    //You could attach as many fields as you prefer
    //Please note that the function name is passed as a parameter to addonchange function
    //Its the function we would like to call during onchange event of these fields.
    Xrm.Page.getAttribute("new_City").addOnChange(FillData);
    Xrm.Page.getAttribute("new_Profession").addOnChange(FillData);
    //No need to add FillData function call on the onchange event of each field on
    //the Form editor instead here we attach it using addOnChange function.
}

//Fill data based on lookup1 - new_City and lookup2 - new_Profession
function FillData() {

    //Js code to fill in the field based new_City and new_Profession
     //For instance you could fill another field using these 2 field values
}


Friday, 7 March 2014

SQL Pivot Based Custom Report in CRM 2011 using SSRS OR Sample Report with SQL Pivot in SSRS

In this post we would try to understand PIVOT relational operator in SQL. PIVOT is useful when we need to develop SQL based reports in SSRS. Please note that this post is based on a sample report in CRM 2011 called Competitor Win / Loss and its not a silver bullet.  If you are an expert in SQL please ignore this post.

With reference from Microsoft,

"You can use the PIVOT and UNPIVOT relational operators to change a table-valued expression into another table. PIVOT rotates a table-valued expression by turning the unique values from one column in the expression into multiple columns in the output, and performs aggregations where they are required on any remaining column values that are wanted in the final output"

Scenario:
The report is based on a very simple concept. An Opportunity which has Competitor / Competitors. As you all know in CRM we might add competitors related to the Opportunity. 

We would like to see a report which displays counts of open, won and lost opportunities against corresponding competitor ( if competitor exists ).

This could be achieved in many ways. But here we are going to try it with SQL PIVOT concept.

1. Lets have a look at the sample opportunities in CRM.


2. An opportunity could have more than one competitors.


3. This report uses temporary tables to achieve the expected results. To have a better understanding, lets divide the query into 2 parts. PIVOT would be applied in the second part.
Please note the comments with the first part query.

--Temporary Table
Create table #CompetitorOppIds (
      opportunityid uniqueidentifier,
      competitorid uniqueidentifier,
      name nvarchar(max),
      statecode int,
      lostto int
     primary key clustered
      (   
            [opportunityid],
            [competitorid]
      )   
)
-- To retrieve the OPEN Opportunities details
insert into #CompetitorOppIds
select oppcomp.opportunityid, oppcomp.competitorid, FilteredCompetitor.name, o.statecode, 0
from   FilteredOpportunity    as o
join FilteredOpportunityCompetitors  as oppcomp
on (o.opportunityid = oppcomp.opportunityid)
-- To retrieve the Competitor Name
INNER JOIN FilteredCompetitor ON
oppcomp.competitorid = FilteredCompetitor.competitorid
where o.statecode <> 2

-- To retieve the Closed Opportunities details ( WON and LOST Opportunities are here)
insert into #CompetitorOppIds
select oppc.opportunityid, oppc.competitorid, FilteredCompetitor.name, o.statecode, 0
from  FilteredOpportunity  as o
join FilteredOpportunityClose as oppc
on (o.opportunityid = oppc.opportunityid and o.statecode = 2 and oppc.statecode = 1 and oppc.competitorid IS NOT NULL)
-- To retrieve the Competitor Name
INNER JOIN FilteredCompetitor ON
oppc.competitorid = FilteredCompetitor.competitorid
--Lets see whats inside the temp table now
SELECT * FROM #CompetitorOppIds

4. And we get the following result in the temporary table.


5. Time for PIVOT. We need a count of Opportunities  ( Aggregate function ) based on unique values of statecode.
ie: If statecode=1  It means its a WON Opportunity
 If statecode=0  It means its a OPEN Opportunity
 If statecode=2  It means its a LOST Opportunity

In simple words, we are going to turn the table by setting the unique values as Columns.

Please note the comments with the PIVOT

-- Here we select the columns to be displayed on our PIVOT result table.
SELECT  name,competitorid, [0] AS openopp,
[1] AS wonopp, [2] AS lostopp
FROM
--Here we select the necessary data for the columns we selected above
( SELECT
competitorid,name, statecode
FROM #CompetitorOppIds ) AS PivotData
PIVOT (
-- In this scenario, we need the COUNT aggregate function
COUNT(statecode)
FOR statecode IN ([0],[1],[2])

) AS PivotResult ORDER BY competitorid

-- finally drop the temporary table
DROP TABLE #CompetitorOppIds


6.  Here is the PIVOT results. 


7. Here is the whole query

--Temporary Table
Create table #CompetitorOppIds (
      opportunityid uniqueidentifier,
      competitorid uniqueidentifier,
      name nvarchar(max),
      statecode int,
      lostto int
     primary key clustered
      (   
            [opportunityid],
            [competitorid]
      )   
)
-- To retrieve the OPEN Opportunities details
insert into #CompetitorOppIds
select oppcomp.opportunityid, oppcomp.competitorid, FilteredCompetitor.name, o.statecode, 0
from   FilteredOpportunity    as o
join FilteredOpportunityCompetitors  as oppcomp
on (o.opportunityid = oppcomp.opportunityid)
-- To retrieve the Competitor Name
INNER JOIN FilteredCompetitor ON
oppcomp.competitorid = FilteredCompetitor.competitorid
where o.statecode <> 2

-- To retieve the Closed Opportunities details ( WON and LOST Opportunities are here)
insert into #CompetitorOppIds
select oppc.opportunityid, oppc.competitorid, FilteredCompetitor.name, o.statecode, 0
from  FilteredOpportunity  as o
join FilteredOpportunityClose as oppc
on (o.opportunityid = oppc.opportunityid and o.statecode = 2 and oppc.statecode = 1 and oppc.competitorid IS NOT NULL)
-- To retrieve the Competitor Name
INNER JOIN FilteredCompetitor ON
oppc.competitorid = FilteredCompetitor.competitorid

-- Here we selet the columns to be displayed on our PIVOT result table.
SELECT  name,competitorid, [0] AS openopp,
[1] AS wonopp, [2] AS lostopp
FROM
--Here we select the necessary data for the columns we selected above
( SELECT
competitorid,name, statecode
FROM #CompetitorOppIds ) AS PivotData
PIVOT (
-- In this scenario, we need the COUNT aggregate function
COUNT(statecode)
FOR statecode IN ([0],[1],[2])

) AS PivotResult ORDER BY competitorid

DROP TABLE #CompetitorOppIds

We need to place the above query in a Dataset and then do the report design
Please refer the below links for the basics.



9. The simple report design is shown is below.


10. Proof is in the pudding !