Friday, 30 May 2014

CRM 2011/ CRM 2013 Connect to CRM Using Outlook Without Joining The Domain

When you try to configure connection to CRM onPremise using Outlook, you can encounter this error.

image

"There is a problem communication with the Microsoft Dynamics CRM server. The server might be unavailable. Try again later If the problem persists, contact your system administrator" when you want to connect to CRM using CRM for Outlook Client.

or

image

It will never ask you and show you prompt to input your credential, unlike the website which will prompt you a credential box. And it is required to you to join Domain.

Basically there are 2 requirements (see number 1 and 2) that are required and recommended
(for onPremise):

1. You implemented IFD in your onpremise

2. You didn't implement IFD it's okay, but you need to login to PC that run CRM for Outlook with the user that join domain not your own user, so let's say your username: mylovelycrm/aileen.gusni

Then your PC user name to login should use this joined domain account, not your private user, for example, aileen-pc.

It will cause the error because you are not using the expected username when you use the CRM for Outlook

But, without join domain you actually can connect using Outlook.
I was thinking that let’ say we are outside from the Domain connection, then go outside without internet, why we are still can connect using the Domain\username username credential?

It is actually store your credential in the Windows Credential as well.

So, to make it works, add your URL to the Windows Credential Manager.

SNAGHTML10e40f2a

And here is the result :

image

This worked for many occassions, if you did not have both requirements, your CRM server didn't implement IFD and your Windows PC User is private user not the joined domain account (didn't meet the minimum requirements)

But, this is also based on the Network Security applied to your Organization.

And..

Of course, you are also required to ensure that the server address URL you type-in is correct and check your Deployment Manager.


Make sure the correct Binding Type (HTTP/HTTPS), server name or using IP, and Port.

Hope it helps!
Thanks.

CRM 2011/ CRM 2013 Customize Connection Role Custom View

In CRM 2011 or CRM 2013, there is a feature called as Connection Role.

When you go to the Connection Role Lookup, there is a custom view : Applicable Connection Roles.
Now, if I go to the Connection Role entity, I cannot create a new View :

image

So, what I can do is create a new view in Advanced Find

image

Now, I want to customize the System View based my Custom View, I want to customize the Columns Layout

Before :



1. First, create a custom view (using Advance Find)
Add new Columns :



2. Use this tool
:
XrmToolBox - View Layout Replicator



Use your view as source

And here is the result :



New fields/columns you defined before has been added.

Hope it helps!

Wednesday, 28 May 2014

CRM 2011/ CRM 2013 Error: Configuration system failed to initialize

When you try to make your custom console connect to CRM, you can have this error :

“Configuration system failed to initialize”

image

Resolution:

Put the StartUp node elements after the ConfigSection

<startup>
 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>


image

So, your config setting will be :

image

Hope it helps!

CRM 2011/ CRM 2013 Error : A configuration element with the name 'Xrm' under the 'contexts' collection does not exist.

When you follow this :
http://msdn.microsoft.com/en-us/library/gg695803.aspx

This will give you error :
“A configuration element with the name 'Xrm' under the 'contexts' collection does not exist.”
Then, luckily, I try then find this link

http://msdn.microsoft.com/en-us/library/gg695805.aspx

Resolution:

The following shows part of the default configuration file that you should set:
<configuration>

 <configSections>
  <section name="microsoft.xrm.client" type="Microsoft.Xrm.Client.Configuration.CrmSection, Microsoft.Xrm.Client"/>
 </configSections>

 <connectionStrings>
  <add name="Xrm" connectionString="Url=http://crm.contoso.com/xrmContoso"/>
 </connectionStrings>
 
 <microsoft.xrm.client>
  <contexts>
   <add name="Xrm" type="Xrm.XrmServiceContext, Xrm"/>
  </contexts>
 </microsoft.xrm.client>
 
</configuration>


image

Hope it helps!

Tuesday, 27 May 2014

CRM 2011/ CRM 2013 oData Error When Passing Dynamic Date as Parameter : Unrecognized 'Edm.DateTime' literal 'datetime'2014-05-12T04:5:28Z'' in '75'

In this link, there is a guide to pass the date parameter to oData method.
http://msdn.microsoft.com/en-us/library/gg328025.aspx#BKMK_WorkingWithDates

Then this is the function

function getODataUTCDateFilter(date) {

 var monthString;
 var rawMonth = (date.getUTCMonth()+1).toString();
 if (rawMonth.length == 1) {
  monthString = "0" + rawMonth;
 }
 else
 { monthString = rawMonth; }

 var dateString;
 var rawDate = date.getUTCDate().toString();
 if (rawDate.length == 1) {
  dateString = "0" + rawDate;
 }
 else
 { dateString = rawDate; }


 var DateFilter = "datetime\'";
 DateFilter += date.getUTCFullYear() + "-";
 DateFilter += monthString + "-";
 DateFilter += dateString;
 DateFilter += "T" + date.getUTCHours() + ":";
 DateFilter += date.getUTCMinutes() + ":";
 DateFilter += date.getUTCSeconds() + ":";
 DateFilter += date.getUTCMilliseconds();
 DateFilter += "Z\'";
 return DateFilter;
}

Sometimes it works, but sometimes it does not. It depends on the time you send.
Like in my experience, I face this error :

“Unrecognized 'Edm.DateTime' literal 'datetime'2014-05-12T04:5:28Z'' in '75'”If I pass the millisecond as well, it also show error :
image

Because actually, after I try to access the URL that I build, yes, it result the error.

SNAGHTML17ab46c


Here is my URL :

http://localhost:5555/dev/xrmservices/2011/OrganizationData.svc/tfp_rasdiscountrateSet?$select=tfp_DiscountRate,tfp_PeriodMonth,tfp_rasdiscountrateId&$filter=tfp_EffectiveFrom%20le%20datetime%272014-05-12T04:05:28Z%27%20and%20tfp_EffectiveTo%20ge%20datetime%272014-05-12T04:5:28Z%27%20and%20tfp_PeriodMonth%20eq%2024

Then, I try to another time, it is actually works, then I found out, actually it works if the hours is more than 1 character, for example : ‘2014-05-12T04:55:28Z’

Actually, CRM only accept this format :
YYYY-MM-ddTHH:mm:ssZ

CRM cannot accept this format :
YYYY-MM-ddTH:m:sZ

So, you have to have H, m, and s in two characters format.
And you also do not need to pass until millisecond, it will not work!

If it is 10:8:8, then have to change to 10:08:08
In my case, I have to convert to ‘2014-05-12T04:05:28Z’’2014-05-12T04:55:28Z’’2014-05-12T04:5:28Z’’

Let me try the URL

http://localhost:5555/dev/xrmservices/2011/OrganizationData.svc/tfp_rasdiscountrateSet?%20$select=tfp_DiscountRate,tfp_PeriodMonth,tfp_rasdiscountrateId&$filter=tfp_EffectiveFrom%20le%20datetime%272014-05-12T04:55:28Z%27%20and%20tfp_EffectiveTo%20ge%20datetime%272014-05-12T04:05:28Z%27%20and%20tfp_PeriodMonth%20eq%2024

And it works

SNAGHTML1807a54

Resolution :

Change your getODataUTCDateFilter() function to :

function getODataUTCDateFilter(date) {
    var monthString;
    var rawMonth = (date.getUTCMonth() + 1).toString();
    if (rawMonth.length == 1) {
        monthString = "0" + rawMonth;
    }
    else { monthString = rawMonth; }

    var dateString;
    var rawDate = date.getUTCDate().toString();
    if (rawDate.length == 1) {
        dateString = "0" + rawDate;
    }
    else { dateString = rawDate; }

    var hourString = date.getUTCHours().toString();
    if (hourString.length == 1)
        hourString = "0" + hourString;

    var minuteString = date.getUTCMinutes().toString();
    if (minuteString.length == 1)
        minuteString = "0" + minuteString;

    var secondString = date.getUTCSeconds().toString();
    if (secondString.length == 1)
        secondString = "0" + secondString;

    var DateFilter = "datetime'";
    DateFilter += date.getUTCFullYear() + "-";
    DateFilter += monthString + "-";
    DateFilter += dateString;
    DateFilter += "T" + hourString + ":";
    DateFilter += minuteString + ":";
    DateFilter += secondString + "Z'";
    return DateFilter;
}

Hope it helps!

CRM 2011/ CRM 2013 OData Datetime Passing Parameter

To pass the date as parameter in oData filter, you can use this format:
filter=tfp_EffectiveFrom le datetime'2014-05-12T04:05:28Z'

To pass the date as parameter to filter using oData to get the data in between certain Date, for example : StartDate= < dateParam <= EndDate

You can use this :

filter=tfp_EffectiveFrom le datetime'2014-05-12T04:05:28Z'
and tfp_EffectiveTo ge datetime'2014-05-12T04:05:28Z'

Which is '2014-05-12T04:05:28Z' is the Dynamics Parameter

Please refer to this link :

http://msdn.microsoft.com/en-us/library/gg328025.aspx#BKMK_WorkingWithDates

Sunday, 25 May 2014

CRM 2011/ CRM 2013 Error when Quote Close As Won Message : The entity cannot be closed because it is not in the correct state

If you use custom code or workflow or dialog to Close Quote As Won, you might be facing this problem:

image

Cause :

Because your Quote status is currently Draft or Already Won.

image

To solve this :

Make sure that your Quote is already Activated, because it is the valid status before you close the Quote as Won.

Otherwise, you will face this issue, don’t forget to check your Quote Status.

Friday, 23 May 2014

CRM 2011/2013 The Power of Description

When you create a New Field, often, we just put the name of the field, that’s all and does not care the others, since it is not mandatory as well.

Sometimes Description is important, don’t underestimate its function, and don’t just let it blank. It can save your life later, I am seriously saying like that Smile

Okay, let’s go to a custom field in Account as example.

Let’s say I create a custom field to link Account with Country, I replace the text field standard field Address 1: Country to this field, then put in the Form to get the field in the Template.

First, we download the Import Template for Account, then get this one :

image

Well, we can see the tooltip description, actually it gives nothing, but just a common information, who care about this.

Then, you give a proper description on this field.

image

Then, save this.

There are 7 advantages so far I can tell because of this field.

1. I create a custom field, then I give information about this, so that my project mate also can see this field and its information, “what is my purpose”, and “what is its usage”.

Then, later, next 2 years, maybe customer wants to upgrade the version of CRM, then I might be forgot already why I should create this field?

2. When you want to see the detail of the field in the Form.

image

3. In the Form, I can help user to know what the field is.

In CRM 2013, we can have a tooltip, if in CRM 2011, the tooltip is the from the Label Name only.

image

4. In the Data Template

image

It gives you clearer Information, not just only say, it is “Unique identifier…”

5. In the time of making Processes

image

6. It saves your time to create a Documentation.

You are as Consultant then want to create a Functional Design Document, you can use tool to generate the Metadata.

image

And you can get the result, s not only showing the standard information for the Description field.

image

Well, if number 1-5, they will help Functional Consultant and Users, now let’s help your Technical Consultant or the one who Develop the custom code.

7. To make it enable in the Early Bound Class

image

Yes, it is very helpful if your field is not easy to be guessed, such as hidden or special field for flag, so better way is by giving the field a proper detail description.

Do you find another advantage for number 8? Then, comment and tell us!

Thanks and hope it helps!

CRM 2013 : Integrating CRM Web with Google Analytics

Actually, we can integrate CRM with Google Analytics to analyze the Visitors.

I was thinking this when I try to analyze a blog. Then, I try to use my crm Demo Online as the tracked website.
To create an account, Go to this : http://www.google.com/analytics/

Then I create, then get the script code.

image

Then I create a Web Resource to store this script

image

Then Show to one of the Form, or any page you want, or maybe you create your Landing Page or can be Dashboard.

This is my GA was installed

image

Then, give them some times to refresh the tracking result.
And here you go, you can see the visitor++

image

image

image

Hope it helps!

Connect to CRM 2013 OnPremise as OData Feed Service Excel Power Query Without Windows Credential (Join Domain)

In My Previous Post, I was talking about Power Query for generating the CRM Data. The data source can be various, from SQL Server, Online Search, Public Data, Web, OData, etc.

Now, I am talking about connect to CRM Data using OData Feed Request.

Here, are some good blogs explaining about connect to CRM Data, either Online or OnPremise, good for reference and inspiration.

*Online
http://niiranen.eu/crm/2013/12/connecting-crm-online-odata-feed-excel-2013-power-query/

Using CRM Online and Office 365 Authentication

*OnPremise
http://www.mindthecloud.net/?p=1020

Using CRM OnPremise and Windows Authentication.

If you have OnPremise Data, you also can access using SQL Server Authentication, it is easier.

But, right now, I want to access to CRM Data (OnPremise), that I cannot access to the SQL Database, and now my Windows Credential is not supported, since my PC is not joining Domain. I also don’t have the Office 365 Authentication.

Then, I try to access my CRM OData Feed :

SNAGHTML1690690c[9]

Then, I click OK, it will prompt and challenge you for inputting correct Credential as I expected, since I don’t have default Credential for accessing this link.

SNAGHTML16a121fe

Then, try to input the Credential

1. Using Anonymous

SNAGHTML16a07bda

Result : The user was not authorized

2. Using Windows

SNAGHTML169d4c0f

Result : The user was not authorized

3. Try using Basic, also cannot.

SNAGHTML169fe661

Result : The user was not authorized

4. Using Web API

SNAGHTML169fab9a

Result : I don’t know what value to be inputted as Key, so cannot be authorized.

5. Using Marketplace key

SNAGHTML16a3cede

Result : I don’t know what value to be inputted as Key, so cannot be authorized.

6, Using Organizational account

SNAGHTML16a6f718

Result : since this is not CRM Online and not support the Office 365 Authentication, so cannot be authorized.

I was thinking about this, it should be Basic can afford this one, but in this case, I cannot use the Basic Authentication, I don’t know why.

Then, I suddenly found a workaround by remembering some old-fashioned way, there is to use the Windows Credential Manager.

To fix this :
1. Go to Windows Credential Manager
It is located at: “Control Panel\All Control Panel Items\Credential Manager”
Or you can just type it in the Search Box of Windows.

2. Then Add a Windows Credential

image

3. Type in the Information you usually input to access your CRM through Browser.

Entry your Server URL (without port), let’s say you want to access :

http://mycrmserver:5555/Contoso/XRMServices/2011/OrganizationData.svc/
or
http://175.111.222.18:5555/Contoso/XRMServices/2011/OrganizationData.svc/

Just type the mycrmserver or 175.111.222.18

image

4. OK and Save, here is the summary.

SNAGHTML16942345

Back to Your excel, and try connect using Windows Credential, and it will work.

SNAGHTML16a9145a

You also can filter the Query using URL:
http://mycrmserver:5555/Contoso/XRMServices/2011/OrganizationData.svc/ContactSet

Hope it helps!

Using Excel Power Query Online Search to Get Tons of CRM Data

I was attending a SQL Server 2014 Launching in Malaysia. Most of them were talking about PowerBI and SQL on the Cloud. Then, one of the best feature I can realize is the capability of Power Query to Query using external data source from Online Search.

It means that Power Query has capability to extract Public Data into directly to the Worksheet Table, without letting the user open the browser, then getting the data, copy one by one to the Excel table records. Wikipedia is one of the greatest source, they provide us the raw data.

Then, I was thinking to utilize this capability to get many data to our CRM demo purpose or Live purpose. When I had a presales activity and demo, what I did at the time is getting the raw data from Google then transform it into the Excel Table. Well, it is not efficient, since the data format from that Web is not in Excel or .CSV, so that I had to copy the data one by one to build a Excel Dataset to be converted as .csv file to be imported to CRM Database. Preparing data for demo sometimes is requiring more effort than developing it Smile

Okay, then luckily, I found this method and I will explain to you.

So, my requirements are:
1. Get the Country List around the world, together with the ISO Code as Country Code
2. Get the State or Province List of Indonesia

What you and I need are:Excel 2013 or older version with Power Query.

You can download the Power Query add-on from this URL :
http://www.microsoft.com/en-my/download/details.aspx?id=39379

And here is the prerequisite for Power Query

System Requirements


Supported Operating Systems:
Windows 7, Windows 8, Windows Server 2008 R2, Windows Server 2012, Windows Vista
    • Windows Vista (requires .NET 3.5 SP1)
    • Windows Server 2008 (requires .NET 3.5 SP1)
    • Windows 7
    • Windows 8
    • Windows 8.1

    The following Office versions are supported:
    • Microsoft Office 2010 Professional Plus with Software Assurance
    • Microsoft Office 2013 Professional Plus, Office 365 ProPlus or Excel 2013 Standalone

    Microsoft Power Query for Excel requires Internet Explorer 9 or greater.
    Microsoft Power Query for Excel is available for 32-bit (x86) and 64-bit (x64) platforms, your selection must match architecture of the installed version of Office
Then here is the link about Power Query :

http://office.microsoft.com/en-001/excel-help/introduction-to-microsoft-power-query-for-excel-HA104003940.aspx


Then, here is the Magic.

1. First, go to Excel
2. Go to Power Query and Search Online
3. Type what I want to search and get the result
 
image

4. Double Click and I get the Data
 
image
 
I can manage the Column as well to adjust my CRM Fields
 
image
 
image
 
5. Then I do the same thing for my next requirement.
 
image
 
Let’s say you have multiple data source, then you can use Merge as well
 
image


If I don’t use this feature, I have to go to the Public Data, for example Wikipedia to get the data and then copy paste to our Excel file.

image

And beside that, I also can go to specific web URL and specific Database as source as well, based on the Authentication, of course, since some of them are not public data.

From Web :

image


image


From OData
To get the Product Sample

image


image


From Database

image
 
By using this guy’s help, I can generate many data to my CRM without compiling, copying, and pasting the data from Public Data to Excel Smile It gives me a very good shortcut.

Hope it helps!