Archive for the 'Customizations' Category
I just finished watching a Partner Session entitled a Technical Deep Dive of CRM Solution Accelerators. This session was focused on the 8 new releases of Microsoft CRM 4 Acelerators.
I think that the team has done a great job getting these out for release. The first releases are to partners and customers are slated for as early as the end of this week.
The Solution Accelerator demo videos are going to be posted on the PLC and Partnersource by the end of the week as well. There will also be additional collateral such as BDM and TDM decks, Whitepapers, etc on each solution accelerator from what i heard in the session.
It was funny because the sessions were so crowded that keeping a decent internet audio connection was quite horrible. I will keep you posted as i get to try these out for myself.
I spent a few minutes this afternoon looking at a quick way to create a signature in an email without having to attach an email template everytime to get the effect that i was after. I basically just wanted to click a button instead and have CRM take care of adding it for me. I only spent about 30 minutes on this so it isn’t quite perfect but it is just a simple workflow that runs and creates the email sig for me in my emails.
There is 2 different ways that you could really implement this as well. You can have this happen everytime you create an email, or when you select a button or something else to trigger inserting the signature automatically. I chose the latter because i don’t want my info attached on every email especially some of the templates i send as well. With that said off to the example.
First make sure that the user you are testing with has the information filled out in their ‘users’ profile information in CRM because this is where we are going to pull the information from. Create a new attribute on the email form named “sti_insertsig” or something i make it a bit variable. Next, i just placed the variable on the email form (Near the Top) and named it Insert Signature and changed the formatting of the field to a checkbox (as shown in the image below).
Next, Just create a workflow. I named mine EmailSignature WF. After naming the workflow to whatever you wish make sure that you are creating a workflow for the “email” entity. Then select the workflow to start when “new record is created”, and “record attributes change” click the select box and then select the email attribute that you created earlier.
Next you just have to add your fields to the workflow in the body of the email that you want updated when the user clicks insert signature and then clicks save. I added firstname, lastname, email, etc. into the body of the email. (as in image below)
Now save and publish your changes. Now when you create a new email all your users have to do to insert their signature is click on the insert signature field and click save. Then they type whatever additional information they need in the email. This is also handy for getting a default signature template for the whole organization to use. Not super fancy, but like i said it was done in like 30 minutes or less.
Your overall effect should be something like the following, and you can get as elaborate as you wish with your email sig’s.
Well i just finished up my latest read “Programming ASP.NET” 3rd edition. I typically develop web applications in Classic ASP, HTML/XHTML, CSS, VBScript, and Javascript. I haven’t had the time to delve into the .NET development framework until now and i thought that this book would be a good entrypoint to get caught up on the new server side processing and controls that the framework has to offer.
I started by installing Visual Studio 2008. Honestly the book is written for the .NET 2.0 framework but i thought this would be give me a great start to get familiar with the new IDE. I was right and i did enjoy reading the book through the week. I would reccomend this book to any developer that is looking to extend functionality of Microsoft CRM or Dynamics Platforms through the native application SDK’s as well.
The book also has a decent chapter on building and consuming webservices. It covers more about exposing your webmethods and using them to return or receive data than most articles that i have found out there. I liked the new controls enough that i decided to purchase the new “SAMS ASP.NET 3.5 Unleashed” (Again…. i know…. Not a Microsoft Press Book!)
I figure that i can get some more in depth information on Windows Workflow Foundation (WF) and the new .NET Ajax Controls that are supported natively in the edition of the framework.
After that i believe i will tackle chapter 9 in the “Working with Microsoft Dynamics CRM 4″ book that i received at convergence. Yea! finally a mention of a MS Press Book Right? By the way this is a great book as well, i just haven’t plowed through chapter 9 entitled “Microsoft CRM 4 SDK”as of yet i have a feeling that this time it will be alot easier with a better understanding now of C# and ASP.NET!
So what is FetchXML? What can it do? and how can i easily utilize the functionality it provides? Some of these may be the questions that you have had and if this is the case this article may provide some clues to help you in your CRM endevours.
Fetch by definition (Thanks MSDN) is a proprietary query language that is used in Microsoft CRM, and is used with the Fetch Method. What this translates to is basically a question and a response. For example you want to know how many accounts have addresses in Tennessee. You can simply form a query to the server by using fetch and get the information that you need.
Fetch is great at providing data easily for use inside crm, outside crm (such as via a webservice), and for other items like pre-filtering lookup fields in CRM. There are many ways to also utilize FetchXML so lets talk a little about the Structure of a Fetch Query.
So now that we are getting started looking at fetchxml structure you really should visit http://www.stunnware.com/crm2/topic.aspx?id=FindingData6 and click on the “Download” Area to download the FetchXML Wizard Software. You don’t have to have this by any means to write fetchxml queries, but it will definately be easier on you.
Below is an example of a fetchxml query.
<fetch mapping=”logical” distinct=”true”>
<entity name=”email”>
<attribute name=”from” />
<attribute name=”ownerid” />
<attribute name=”sender” />
<attribute name=”subject” />
<filter>
<condition attribute=”ownerid” operator=”eq” value=”{AD1A55EE-D5AC-DC11-BF6D-000D60559FC9}” />
</filter>
</entity>
</fetch>
There are a few things to examine in the structure of this query. The first thing is to define the mapping of the query. This is the first line that defines the query, i have also specified distinct=”true” this means that i am looking for unique only records in my resultset.
<fetch mapping = “logical” distinct=”true”>
The next line: <entity name=”email”> Defines the entity (or you can think of this as a table in the database) that we are going to query for record information. In this case it is the email entity.
Next you will see the following lines:
<attribute name=”from” />
<attribute name=”ownerid” />
<attribute name=”sender” />
<attribute name=”subject” />
These are the attributes or basically the columns in the database that we are going to bring back in our query. So far we have outlined the information we want to pull out but what really specifies the criteria that this data is captured? This is where the filter element comes in. With the filter element you can specify which attributes should have specific criteria in order to create your result set.
In the above example this is specified by the following condition attribute:
<condition attribute=”ownerid” operator=”eq” value=”{AD1A55EE-D5AC-DC11-BF6D-000D60559FC9}” />
This is basically saying that the ownerid of the email is going to equal me. Just about every operator is supported so it is unlimited the types of comparisons that you can do.
That is all there is to a fetch query. With this query i can now pull all emails from our demo system here that i happen to be the owner of. There is a ton more that you can do with fetchXML so here is a quick usage for these types of queries.
This is known as lookup filtering and can be done with any supported lookup attribute in CRM. On the onload event for the account form add the folowing code
***** Beginning of Code
var accountID = crmForm.ObjectId;
crmForm.all.primarycontactid.lookupbrowse = 1;
crmForm.all.primarycontactid.additionalparams = “fetchXml=<fetch mapping=’logical’> <entity name=’contact’> <all-attributes/><filter type=’and’><condition attribute=’parentcustomerid’ operator=’eq’ value=’” + accountID + “‘/><condition attribute=’statecode’ operator=’eq’ value=’0′/></filter></entity></fetch>”;
crmForm.all.primarycontactid.additionalparams += “&selObjects=2&findValue=0″;
***** End of Code
The purpose of this short code is to pull the GUID of the current account that is open and then pre-filter the primarycontactid form with only available contacts that have been related within CRM to that account. This pre-filters the results and is easy to accomplish.
There are lots of interesting places in CRM you can filter to save yourself some time with searching. This is just a quick example to give you an idea of the possibilities. Until next time.
Take Care!
Now this isn’t a perfect example, but this is an easy implementation to check the format of email addresses that are entered into Microsoft CRM. Like i mentioned before this isn’t perfect, but does a decent job without alot of work.
Through a (regex)or regular expression you can make light work of data validation in CRM. Below is a sample that first looks up the value of the emailaddress1 field. Then it simply compares the text entered against the validEmail function, and returns whether the email matches or doesn’t match the criteria specified.
In this case if it doesn’t match the format then it basically states that the email entered is not in the correct format. This code below can actually be changed to whatever you desire, and can easily be copied to the onchange event of any field that you wish to run email validation on. This is just a simple example of a regular expressions and this can be built upon to provide much more complex testing. Hope it helps. Take Care!
var str = crmForm.all.emailaddress1.value;
if (!validEmail(str)) {
alert (’This Email is not in the correct format. Example: nicholasc@saratogaus.com’)
}
function validEmail(str) { return str.match(/^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z]{2,4}/i); }
