Thursday, August 9, 2012

Show/copy ID (Guid) of Entity Record in CRM Form

While working on CRM projects, it's often necessary to get the GUID for an entity record within the CRM UI. One way to do this is to use the Copy Link feature from the form, paste the link to notepad, and then manually extract the id. A faster approach is to create a browser Favorite that runs JavaScript that reveals the ID, making it easy for you to copy.

Setting Up the Browser Favorite

  • Open up an entity form and then press Ctrl+N to open the form in a new window that has the address bar showing.
  • Add that current page as a Favorite
  • Edit the properties of the Favorite. On the General tab, type "Show GUID" as the shortcut's name.  On the Web Document tab, provide the JavaScript shown below.

javascript:(function() {var d=document.URL;var s = d.search(/id(%)3d(%)257b[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-Z0-9]{12}/);window.prompt('Record ID:',d.substring(s+10, s+46))})();

  • Click OK to save the Favorite.


Using the Favorite to Show an Entity Record's ID

  • Open an entity form.
  • Press Ctrl+N to open a new window that shows the Favorites bar.
  • Click the Favorite to show the record's ID.

Sunday, May 20, 2012

MSCRM rocks and you can too!

A quick music tip today... back to CRM work tomorrow.
One of the benefits of working on a PC most of the day is I can put on the headphones and crank up the tunes, in between meetings of course. To keep on top of new releases I use muspy. And after a long week of consulting and coding, I try to sneak out and catch a live show. So, to learn about upcoming concerts in my area, I use Songkick.

It would be great if muspy and Songkick got together so that you can enter your favorite bands on just one site and get new release and concerts from one source. My other wish is that they'd at least integrate so that an entry on one site would auto-add to the other site. No luck there either.

What I recommend is to start with Songkick. They make it easy to find and select bands. Then, to get the bands over to muspy, select the band list from Songkick (copy to clipboard), use Notepad++ or similar editor to make the list comma-delimited (create a simple macro), and then paste it in muspy's search/add box. Yeah, this is a one-time data migration, but I had 200+ bands in Songkick and got them over to muspy in about 5 minutes.

So there you go. Now you'll know about upcoming concerts (I just saw that Train is coming to town soon and my wife LOVES Train) and new music releases for only those bands you care about, like Santana (just released) and Joe Satriani (great background music while working).

Cheers,

-Tim

Friday, May 11, 2012

Career Opportunities at Altriva (Bellevue, WA)

It's a great time to make a move to Altriva and put your development and consulting skills to work using Dynamics CRM 2011, SharePoint, and more. If you enjoy working on business-driven projects where you can help organizations work smarter, more efficiently, and want to use the latest software tools, take a look at Altriva.

Below are just a few reasons why you'll love working at Altriva. These are my thoughts based on being a part of the Altriva team (as a Solution Architect) for nearly four years.
  1. Reputation: Our team is well known for its ability to deliver solutions that exceed the expectations of our clients. If you want to join a team that is laser-focused on customer satisfaction and project success then you've found the right place.
  2. Knowledge: Altriva's founders and leaders have a long track record of successful project delivery. It's great working with a team that has a tremendous depth of experience. And through training and working on large CRM projects, our entire team is very skilled at delivering solutions for small to very large organizations. If you have a passion for learning and sharing knowledge with others then you'll love it at Altriva.
  3. Culture: From our team lunches, social outings, sports, and barbecues to charity events such as The Big Climb in Seattle, Altriva is a very fun and rewarding place to build your career and be part of a team.
  4. Microsoft Partnership: Altriva benefits from not only being a Microsoft Gold Certified partner, which we need to earn each year through certifications, but our partnership also helps us with project leads, the ability to work on-campus at Microsoft, and excellent training opportunities.
If you'd like to learn more about Altriva, send me an e-mail at tdutcher-at-altriva.com and I'll get in touch.

Cheers,

-Tim

Tuesday, May 8, 2012

Sort SiteMap Links in Extensions Section


I'm working on a CRM 2011 on-premises project where the team has created 35 custom entities so far. A majority of the custom entities are in the Extensions section of the SiteMap until we decide where they will live permanently. CRM doesn't sort the entities in the Extensions section but there's a way to do this. Steps:

  1. Create a solution and add the SiteMap to it
  2. Export the solution and make a backup of the zip file
  3. Extract the zip file
  4. Open customizations.xml in a text editor
  5. Scroll down to the node:  Group Id="Extensions"
  6. Copy all of the nodes and paste into a new Excel worksheet
  7. Sort the rows
  8. Copy the text in Excel and paste it over the nodes
  9. Save the file, add it back into the solution zip file (overwriting the existing customizations.xml file)
  10. Import the solution and publish
  11. Hit F5 to refresh the CRM page
  12. You should see that the Extension entity links are now sorted


Maybe there's an easier way but this did the trick.

Use log4javascript with Dynamics CRM 2011

If you’ve been using the Jscript alert function to display the value of variables in your Dynamics CRM 2011 form scripts, or find that using the F12 debugging tools are often cumbersome, consider using log4javascript for an alternative approach to analyzing and debugging code.  log4javascript is a logging framework that is easy to add to CRM as a Web Resource.  Within your code, simply add log statements for anything you want to output and log4javascript will display the log output in a separate window.  You can even filter on different levels of logging so that you see only errors, warnings, or everything.


-          Click Files link, then click log4javascript link

-          Download the zip file, save to disk, and extract file

Adding log4javascript as a Web Resource in CRM 2011:

-          Create a script Web Resource and select log4javascript.js.  My recommendation is to use the name “new_/Common/log4javascript.js” as the Web Resource name.  This will place the script in a path under “Common” where you can also store other common libraries such as jquery and json.

-          You should also add the stub version of log4javascript into CRM as a second Web Resource. The stub version of the file contains only the log4javascript function declarations.  The stub version allows you to keep your log statements in place in your CRM form scripts but turn them off by replacing the use of the full log4javascript.js Web Resource with the stub version.  To add the stub version, creating another Web Resource named new_/Common/log4javascript_stub.js.

-          Publish customizations

Using log4javascript:

-          In a form where you would like to log output, add log4javascript.js to the form’s libraries.

-          In a form’s script, add the following statement to the top of the form or in a location outside script functions:   var log = log4javascript.getDefaultLogger();

-          In places in your code where you want to see the value of variables, enter a statement such as the following:   log.info("MyMethodName: clientName=" + clientName);

-          Publish the form
Now, as your form script executes, you’ll see logging output in a separate window, with the ability to filter, search and sort the logging output.  The output also includes the execution time (to the second) and this can also help identify script code that you might need to optimize.