Tag Archives: CRM2015

Outlook Plugin with CRM Online & Office 365: Tracked Items Aren’t Tracked

Published by:

We recently ran across an issue when setting up CRM Online 2015 Update 1 with Office 365 Exchange Online. A user installed the Outlook plugin, and could click the Track and Set Regarding functions – even select which record it should be Regarding – but the record never made it to CRM. The original symptom wasthe “Convert To” function was grayed out no matter what we did.

The issue is that in some cases, the Email Server Profile defaults to a value that doesn’t work. Both Incoming Server Location and Outgoing Server Location need to be set to

https://outlook.office365.com/EWS/Exchange.asmx

But how? The field disappears almost immediately, and you can’t create a new form against this entity, nor can you create workflows.

So I forced it to reopen by using the F12 debugger and setting the field to be editable. For example, incomingserverlocation can be edited by opening the F12 debugger and removing the applicable clause. For example, here, you would remove the part that says disabled=”disabled” altogether. This opens up the field to be edited.

2015-08-05 14_02_04-Inspector - https___xxxxx.crm.dynamics.com_main.aspx_etc=9605&extraq

You need to do this for the three fields.

  • Autodiscover Server Location = No
  • Incoming Server Location = https://outlook.office365.com/EWS/Exchange.asmx
  • Outgoing Server Location = https://outlook.office365.com/EWS/Exchange.asmx

2015-08-05 13_54_43-Email Server Profile_ Test 2 - Microsoft Dynamics CRM

Then associate your user(s) to the profile. You then need to approve them and click the Test button.

But mine came back with this error:

Email cannot be sent because the email address of the mailbox John Smith requires an approval by an Office 365 administrator. The mailbox has been disabled for sending email and the owner of the email server profile Test 2 has been notified.

Make sure the person doing the approving and testing is both an Office 365 admin and a CRM admin.

CRM for Phones: “A primary entity column cannot have a dot in its name”

Published by:

When using the new CRM For Phones and CRM for Tablets apps against Microsoft Dynamics CRM 2015 Online Update 1, I was getting the following error.

“Sorry, something went wrong while initializing the app. Please try again, or restart the app.”

I looked into some of the standard troubleshooting steps for this one and none of them applied.

So I enabled tracing. It was a big PITA to install all 150mb of iTunes and wait for sync, but it was worth it because I found the following error in the logs.

Error Message:Microsoft.Crm.CrmInvalidOperationException: Unable to process the following entities - contact. Please try disabling the entities and try again. ---> Microsoft.Crm.CrmException: A primary entity column cannot have a dot in its name

The key being A primary entity column cannot have a dot in its name.

Because “having a dot in its name” alludes to an aliased field, I checked that my custom code didn’t contain anything odd – it didn’t. I finally found the problem in a corrupt View definition.

2015-07-27 13_36_02-View_ Contacts_ No Orders in Last 6 Months - Microsoft Dynamics CRM - Internet E

2015-07-27 14_44_14-Message from webpage

After removing the bad columns, the mobile app fired up no problem.

E-Mailing Line Item Details

Published by:

It’s great how everything in CRM uses the XRM object model – it’s so easy to link entities.

But sometimes it can be annoying. Like, what if I want to e-mail a Quote to a customer, or to an internal customer service person who may not be a CRM user? I can’t just drop the line items into an workflow email since it’s a 1:N.

I created a custom workflow activity that does just this. It takes a sales entity’s line items (Opportunity Product, Quote Detail, Order Detail, or Invoice Detail) and assembles it into a string that you can drop into an email. It’s configurable on how it handles bundles and with currency symbols.

Check it out on Codeplex!

Codeplex Project

Business Process Flows: Tweak A Global Process Based on User’s Role

Published by:

I recently had a requirement for Business Process Flows – a pretty standard lead to order process. The challenge was that the client had an optional first stage they called “pre-lead,” which would only apply to users on a certain inside sales team. In other words, when the Lead was created by Steve, it was supposed to get process A; but if started by Sally, it’d get process B.

Normally you could do this with two flows controlled by user roles and prioritization. But it was important that everyone have access to both flows since both types of resources could work on a given opportunity, so that was out.

The solution was to create two flows and assign it at the time the record is created.

On the User record, create a flag indicating which process they should default to.  I called it ics_defaultleadstoprelead. You’ll also need a system field on the Lead, which I called ics_processflowset, defaulted to no.

We’re going to use Xrm.Page.data.process.setActiveProcess() for this, but the gotcha is that you can’t use it on create. So our logic is:

  • If Form Type == Create
    • Hide Business Process Flow
  • Else
    • If the type has not been set yet (ics_processflowset == no)
      • Determine which process flow should be active on the Lead based on the flag on the User.
      • Set the type.
      • Set the flag (ics_processflowset) to not change it later.
    • Show the flow.

Here’s the code. It utilizes a utility library I have.

  • ics_util.getSingleton() fires a Fetch and returns one field from one returned record. This is very useful for pulling one attribute off of a given record where I have a GUID.
  • ics_util.setFieldValue() just sets a field value.

 

var ics_lead = function () {
	
	SetDefaultLeadState = function () {
	
		if (ics_util.getFormType() === ics_util.FORM_TYPE_CREATE)
		{
			Xrm.Page.ui.process.setVisible(false);
		}
		else
		{
			Xrm.Page.ui.process.setVisible(true);
			if (ics_util.getFieldValue("ics_processflowset") === false)
			{
				var fetch = 
				'<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">'+
				'  <entity name="systemuser">'+
				'    <attribute name="systemuserid" />'+
				'    <attribute name="ics_defaultleadstoprelead" />'+
				'    <order attribute="ics_defaultleadstoprelead" descending="false" />'+
				'    <filter type="and">'+
				'      <condition attribute="systemuserid" operator="eq-userid" />'+
				'    </filter>'+
				'  </entity>'+
				'</fetch>';
				
				var tupleValue = ics_util.getSingleton(fetch,"ics_defaultleadstoprelead",false,"There has been an error determining if this should be a pre-lead. (fetch)");

				// (User entity) Default Leads to Pre-Lead? (ics_defaultleadstoprelead) - "Default to Prelead" = 0; "Default to Lead" = 1
				
				// Automatically set lead or prelead process
				if (tupleValue) 
				{
					Xrm.Page.data.process.setActiveProcess(this.PROCESS_ID_NO_PRELEAD, this.onSetActiveProcess);
				}
				else
				{
					Xrm.Page.data.process.setActiveProcess(this.PROCESS_ID_PRELEAD, this.onSetActiveProcess);
				}
				ics_util.setFieldValue("ics_processflowset",true);
			}
		}
	
	};
	
	OnSetActiveProcess = function(returnStatus){
		
		switch (returnStatus) {

		case "success":
			//alert("success");
		break;

		case "invalid":
			alert("There has been an error determining if this should be a pre-lead. (setActive Process returned invalid)");
		break;
		}

	};
	return {
		setDefaultLeadState : SetDefaultLeadState,
		onSetActiveProcess : OnSetActiveProcess,
		PROCESS_ID_PRELEAD : "15dbaafe-xxxx-xxxx-xxxx-990bcd934931",
		PROCESS_ID_NO_PRELEAD : "5db8867d-xxxx-xxxx-xxxx-67afb06a53c9" 
	};
	

}();