Free Webinar: Dynamics CRM Upgrade Processes and Procedures

If you are planning an upgrade from Dynamics CRM 4.0, 2011, or 2013 to Dynamics CRM 2015 there are some things that you should consider and plan for in advance.

We will be discussing the processes you can follow, how to set up your environments, testing, JavaScript conversion, plugin upgrades, and a whole host of other topics related to the upgrade.

Tuesday, September 22nd, 2015 11:00 AM – 12:00 PM CDT       Register Now

Free Webinar: Productivity Maximized using GoToWebinar and Click Dimensions

Hi Everyone,

This year I implemented a new program I call Teaching on Tuesdays where I hold free webinars on various topics ranging from Dynamics CRM, to Xamarin, to business and development best practices.  Averaging at least two webinars a month has allowed me to refine my work so that I have a repeatable process that I can follow each time.

Two of the tools I use on at least a weekly basis, if not daily, are GoToWebinar and Click Dimensions.

I use GoToWebinar (and GoToMeeting) to host all of my meetings and webinars and Click Dimensions handles everything from adding webinar participants to Dynamics CRM, to sending notification emails, to collecting additional information using forms and surveys.

In this webinar we will be discussing the following:

  • Setup and Configuration of the Click Dimensions GoToWebinar connector
  • Planning your webinar
  • Marketing your webinar
  • Reducing webinar SPAM (yes, there is such a thing)
  • Conducting your webinar
  • Recommended equipment
  • Collecting attendance statistics
  • Communicating with both registrants and attendees
  • Recording your webinar and publishing it to YouTube
  • Plus much, much, more

You’ll also receive a step-by-step guide that I have created which documents each of the steps required to plan, host, record, and follow-through with a webinar.

I hope to see you there.

Tuesday, Sept 15, 2015 11:00 AM – 12:00 PM CDT       Register Now

 

Thanks, Mitch

Dynamics CRM JavaScript: Ensure the current record is Saved before opening a new record

In yesterday’s post, Tracing the Dynamics CRM Form Data save Operation, I discussed identifying data that would be sent to the database when you saved a Dynamics CRM record.

Part of the issue I was facing was related to the form not completing the save operation before I opened a new form record. Since Dynamics CRM 2013 and 2015 user interface rarely opens a new window, the user was getting a warning that there was unsaved data when the page was being switched between the Account and, in this case, the Opportunity record.

So to prevent this from happening, I had to wait for the save to complete then open the new Opportunity record.

Here is the code where I do that:

……

var parameters = { customer_id: customerId, customer_name: customerName, customer_type: customerType, name: Xrm.Page.getAttribute("name").getValue() }; var windowOptions = { openInNewWindow: true }; setTimeout(function () { openNewForm(parameters); }, 2000); } function openNewForm(parameters) { var windowOptions = { openInNewWindow: true }; Xrm.Utility.openEntityForm("opportunity", null, parameters, windowOptions); }

The Details

We are using the JavaScript method setTimeout to wait for 2,000 milliseconds (2 seconds for those of us who are not computers).

At the end of the wait period, we will call a function called openNewForm which will use the Dynamics CRM method Xrm.Utility.openEntityForm, which opens a new Opportunity form.

You may need to adjust the wait period up or down, depending on your environment. The idea is to wait long enough for the save to complete, but not long enough to irritate the user.

Tracing the Dynamics CRM Form Data save Operation

I ran into an interesting issue this week where I was opening up a new Opportunity Entity form from the Account record via a Command Bar button.

The issue was that I was getting a warning that I was about to discard changes to the record I was leaving, and would l like to Continue or Cancel.

I verified all of the JavaScript and found that I was not performing any updates on form load, so there must be something else happening to modify a value on the form so that CRM thinks the record needs to be saved.

But what was being changed?

I thought about it for a bit and realized I could have CRM tell me what was happening, though a little known or used method called Xrm.Page.data.entity.getDataXml.

Dynamics CRM, by and large, does not send unaltered data to the database when a Save occurs. By using getDataXml, I can see exactly which field or fields were being modified.

Implementation

To implement this code, I created a small onSave method:

function onSave() {
    alert(Xrm.Page.data.entity.getDataXml());
}

Then created an OnSave event on the form properties:

image

Note: Make sure this event is the final OnSave event to ensure that all of the other OnSave events have completed.

This will display a message box showing what fields have been changed and the new values. Basically the same thing that will be sent to the database.

Resolution

It turns out that in this particular case, I was programmatically:

  1. Setting a field value
  2. Saving the record
  3. Opening a new related record

The issue was that the Save operation had not completed so the field I had modified was still considered dirty.

This allowed me to correct that issue and now things work as expected.

Up Next

My next article will outline how to work around the saving of the record while navigating to another record issue I ran into above.

Free Webinar: Dynamics CRM Plugin Development Basics

Hi Everyone,

Just a reminder of my next free webinar:

Dynamics CRM Plugin Development Basics

In this webinar we will discuss the basics of Dynamics CRM plugin development including: What plugins do, how they are architected, the development tools you will need, and what it will take to develop your first plugin.

Tuesday, August 25th, 2015 11:00 AM – 12:00 PM CDT       Register Now

 

Thanks, Mitch

Dynamics CRM JavaScript: Working with Tabs and Sections-The right way

Back in March I wrote the following article: Dynamics CRM Developer Tip O’ the Day: Working with Tabs.

Today I was working on some pre-existing customer JavaScript and ran across this:

Xrm.Page.ui.tabs.get(0).sections.get(6).setVisible(false); // Hide section

Don’t ever do that! Bad developer! Bad!

So again, never, ever use the numerical value to reference a Tab or a Section, unless you have no choice. 

We don’t want to use numbers because if you move or add Tabs or Sections, your code will no longer work.

Do this instead:

Xrm.Page.ui.tabs.get("General").sections.get("Details").setVisible(false); // Hide section

As long as your Tabs and Sections are named properly, you should not have an issue.

Help! I can’t create quotes!

[Dynamics CRM 2013]

One of my customers emailed in a panic (rightfully so), because they could not create a Quote from an Opportunity.  When they did so, the following error popped up:

image

Actually, you have to hover over the error on the status bar to see it pop up.

I looked around for 30 minutes or so and could not see any issues recorded in any log that you might think of.

He had already restarted the SQL Server and I restarted IIS on the CRM Server but still the error persisted.

Having nothing left to do, I decided to look at the CRM services on the CRM Server.  Sure enough, several were turned off.

Solution

Start/Restart all of the CRM-related services on the CRM Server.

I did a little testing and it appears that the Sandbox Service was the one directly responsible for the inability to add a new Quote, but just to be safe, I restarted them all.

 

This is a very fascinating situation and one that I’ve never seen before.

Free Webinar: The 7 Steps of Dynamics CRM Development

 

Interested in becoming a Dynamics CRM developer or adding to your existing Dynamics CRM skillsets?

In this webinar we will cover the seven areas (steps) you need to master to become a Dynamics CRM developer and will discuss the tools and resources to help guide you on your journey.

Monday, Aug 24, 2015 1:00 PM – 2:00 PM CDT       Register Now

Sharing information and lessons learned with other developers

Sign up for our new KnowledgeBits service and get news, tips and tricks and more, delivered straight to your inbox.