Tim Dutcher's blog covering the technical side of working with Microsoft Dynamics 365 (CRM), Power Platform and Microsoft Azure.
Sunday, December 7, 2014
CRM 2015 SDK - Get organization details from Organization service
A few weeks ago, I was working on a plug-in for a Microsoft Dynamic CRM 2013 project and wanted to add organization-specific logic to it. In CRM version 2013, Microsoft did not provide a way to get organization details using the Organization.svc service endpoint but in CRM 2015 Microsoft added this capability with RetrieveCurrentOrganizationRequest and related classes. This allows for more adaptable code in plug-ins, workflow activities and other applications. For example, you might want to call a different Web API endpoint from a plug-in depending on whether the plug-in is running in production vs. running in a development sandbox instance.
Monday, March 24, 2014
Dynamics CRM Wiki
I'm creating kind of a CRM quick reference here: http://mscrmrocks.wikispaces.com. At Altriva, I work on a wide range of CRM projects, so having a quick guide to CRM functionality (customizations, development, deployment, maintenance, etc.) will be handy. I hope you find it useful as well.
Sunday, March 16, 2014
A "What If" experiment... Evaluate Excel formulas in Dynamics CRM Plug-ins
What if you could combine an Excel engine (one that can evaluate formulas) with Dynamics CRM in a plug-in...
Well, it turns out that you can.
I've only worked on this for a couple of hours this morning (the family is awake now) but here's what I've been able to do so far...
Here's the part of the plug-in code that creates a worksheet, sets a formula, gets the random number and sets the accountnumber field for the new Account in CRM...
WorkBook wkbook = new WorkBook();
wkbook.NumSheets = 1;
wkbook.Sheet = 0;
wkbook.setFormula(0, 0, "RAND()");
wkbook.recalc();
randValue = wkbook.getNumber(0, 0);
entity["accountnumber"] = randValue.ToString();
Here's the plug-in registration details:
And our Account record with the randomly generated account number:
Where to take this next...? Here are some ideas:
Well, that concludes my What If experiment this morning. I hope it inspires you to harness the Dynamics CRM platform to do some creative things to solve business needs... or just pass some time while the family sleeps.
Cheers,
-Tim
Well, it turns out that you can.
I've only worked on this for a couple of hours this morning (the family is awake now) but here's what I've been able to do so far...
- Download and install SmartXLS, a .NET Excel-compatible library.
- Create a simple plug-in that calls the SmartXLS library to generate a random number (using the RAND formula function; SmartXLS supports most Excel functions). The plug-in simply updates the accountnumber field for a new Account with the random value.
- Use ILMerge to merge SmartXLS's XL.DLL with my plug-in assembly. This allows you to register the plug-in and the SmartXLS functionality in a single assembly so there's no need to GAC anything... and this should allow it to work with CRM Online.
- Register a plug-in step for Create message for the account entity, pre-operation, synchronous.
- Create an account record. Voila! We have a random account number. (Not terribly useful, but you get the idea.)
Here's the part of the plug-in code that creates a worksheet, sets a formula, gets the random number and sets the accountnumber field for the new Account in CRM...
WorkBook wkbook = new WorkBook();
wkbook.NumSheets = 1;
wkbook.Sheet = 0;
wkbook.setFormula(0, 0, "RAND()");
wkbook.recalc();
randValue = wkbook.getNumber(0, 0);
entity["accountnumber"] = randValue.ToString();
Here's the plug-in registration details:
And our Account record with the randomly generated account number:
Where to take this next...? Here are some ideas:
- Since SmartXLS can read in XLS files, it's possible to pre-defined formulas in Excel and somehow feed the XLS into the plug-in (perhaps as an attachment to a custom entity). The plug-in will replace value in the worksheet, recalc, and update CRM with the results.
- If a formula needs data from other related entities... that's trickier but certainly possible. A FetchXml statement on a worksheet could define the data to get from CRM. Once the data is retrieved, a formula can get whatever value is needed from the resulting data (e.g., min, max, average, etc.).
- A formula updates values brought in from a FetchXml query. The plug-in updates the CRM records with the resulting values. Think bulk-update with the power of Excel formulas.
Well, that concludes my What If experiment this morning. I hope it inspires you to harness the Dynamics CRM platform to do some creative things to solve business needs... or just pass some time while the family sleeps.
Cheers,
-Tim
Tuesday, March 4, 2014
Time flies when you're having fun
Hey there fellow Dynamics CRM enthusiast, thanks for stopping by. It's been a while since I've posted but here's what I've been up to on various projects here at Altriva:
Siebel to CRM 2011 Data Migration
Catch you later,
Tim Dutcher
Siebel to CRM 2011 Data Migration
- Early last year, we helped a client migrate their data (and configuration/functionality) from a Siebel 2000 system to Dynamics CRM 2011 (on-premises). Given the dozens of migrations I've done in the past, I was up for this challenge and am proud to say that it went very well.
- Our custom data migration application migrated 6.5 million rows across 42 entities. This includes 1.2 million attachments (into SharePoint, encrypted).
- The application scales to an unlimited number of loading machines and instances. On go-live weekend, we used 6 VMs and 3 app instances on each to get all of the data in on time.
- The application is driven by migration steps in SQL Server. It handled the entire migration with very few hiccups. When there were hiccups (network glitches leading to loss of connectivity) the application was able to wait and continue where it left off... and that allowed me to even get some sleep during the weekend.
- One Altriva client needed to generate Word and PDF correspondence (e-mails, letters, faxes, government forms) from CRM, both on-demand and after an event occurred in CRM (e.g., an appointment was scheduled or canceled). The correspondence needed to include data across 5 to 10 entities, so the usual mail merge and template features in CRM would not suffice. Our client had in-house experience with SQL Server Reporting Services so we built the custom correspondence around SSRS and a custom WCF service. The design in a nutshell:
- Create custom Correspondence Template entity in CRM. This stores the path to the SSRS report and sets various parameters/options for each piece of correspondence, such as the type of document to produce, where to attach the generated document, etc.
- Create custom Correspondence Request entity in CRM. A user or an automated process creates a Correspondence Request record. This entity data (correspondence template, "regarding" entities, etc.) is sent to a custom WCF application via plug-in.
- The custom WCF application calls SSRS via web services to generate the Word or PDF document. It then proceeds to display the document in Microsoft Word or Adobe Acrobat or it creates an e-mail record in CRM and sends the e-mail.
- All in all, SSRS worked out well for correspondence. We did find the need to purchase a license to the Aspose PDF product in order to generate the government forms -- the formatting for those was too much for SSRS to handle.
- As you can imagine, Microsoft partners like Altriva were (are) kept very busy helping Dynamics CRM 4.0 and 2011 clients upgrade to CRM 2013. We've helped clients in a wide range of industries upgrade their CRM and it's been fun helping to implement the new features depending on the business's need. We now have iPads and other tablets here at Altriva to test the new tablet functionality in Dynamics CRM 2013. And we have Hyper-V and VirtualBox VMs configured to try out server-side sync with Exchange, Azure and SharePoint integration, and all of the other great new features Microsoft has added to the product.
Catch you later,
Tim Dutcher
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
Using the Favorite to Show an Entity Record's ID
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
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.
Cheers,
-Tim
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.
- 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.
- 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.
- 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.
- 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.
Cheers,
-Tim
Subscribe to:
Posts (Atom)

