0

Default Price List on an Entity

by BenVollmer 19. August 2010 21:25

I had a client that didn’t like to enter the Price List on their opportunity every time because they only had one price list.  So here is a little piece of code to do this. What you will need is two things.

  1. The GUID of your Price List. You can find this in the address bar of the price list in between the { } Brackets.
  2. The EXACT Name of your Price List. Remember, JavaScript is CASE Sensitive. So the best bet is for you to cut and paste the name in to the script.

Put this on your OnLoad Event for your Opportunity, Quote, Order or any other form you want this on.

   1:  var CRM_FORM_TYPE_CREATE = 1;
   2:  var CRM_FORM_TYPE_UPDATE = 2;
   3:   
   4:  switch (crmForm.FormType)
   5:  {
   6:    case CRM_FORM_TYPE_CREATE:
   7:      var lookupData = new Array(); 
   8:      //Create an Object add to the array. 
   9:      var lookupItem= new Object(); 
  10:      //Set the id, typename, and name properties to the object. 
  11:      lookupItem.id = '{A0C40F17-DC1B-DF11-924E-001517C6CCD8}'; 
  12:      lookupItem.typename = 'pricelevel';
  13:      lookupItem.name = 'Main Price List'; 
  14:      // Add the object to the array. 
  15:      lookupData[0] = lookupItem; 
  16:      // Set the value of the lookup field to the value of the array. 
  17:      crmForm.all.pricelevelid.DataValue = lookupData;   
  18:        break;
  19:   
  20:    case CRM_FORM_TYPE_UPDATE:
  21:        break;
  22:  }

The reason for the variables at the top is that CRM wants you to save the record before you add products to a quote for example, so doing this only allows the script to fire when the item is created. Otherwise it will fire every time a record is opened.

Happy Demos!!!

Tags:

Demo Tools

0

Calling Workflow from the ISV.Config

by BenVollmer 12. August 2010 06:21

WARNING: Unsupported.

So I had a customer the other day ask to launch a Workflow directly from a Contact Form. After doing some searching on Bing, I found a couple of different options. One from Inetium was exactly what I was looking for. But the JScript to XML Conversion confused my poor little brain. So after doing a little more searching a little more, here is the article that proved to be the inspiration that I  needed.

So all you need here is as follows:

1. The Workflow GUID. The good news is that is easy to find. Simply open a Workflow Rule Up.

image

2. You MUST make sure that they Workflow is available to Run On Demand and that the Workflow is Published.

image

3. Edit the Enclosed XML File with the right CRM Workflow GUID and Contact ID.

   1: <ImportExportXml version="4.0.0.0" languagecode="1033" generatedBy="OnPremise">
   2:   <Entities>
   3:   </Entities>
   4:   <Roles>
   5:   </Roles>
   6:   <Workflows>
   7:   </Workflows>
   8:   <IsvConfig>
   9:     <configuration version="3.0.0000.0">
  10:       <Root />
  11:       <!-- Microsoft Customer Relationship Management Entities (Objects) -->
  12:       <Entities>
  13:         <Entity name="account" />
  14:         <Entity name="contact">
  15:         <ToolBar ValidForCreate="0" ValidForUpdate="1">
  16:           <Button Icon="/_imgs/ico_16_9_d.gif" JavaScript="launchOnDemandWorkflowForm('', '2','{1A4E2305-9019-44CB-B879- 49C74632DA2E}');" AvailableOffline="true">
  17:             <Titles>
  18:               <Title LCID="1033" Text="Create Portal Login" />
  19:             </Titles>
  20:             <ToolTips>
  21:               <ToolTip LCID="1033" Text="Create A Portal Login" />
  22:             </ToolTips>
  23:           </Button>
  24:         </ToolBar>
  25:         </Entity>
  26:         <Entity name="lead" />
  27:         <Entity name="opportunity" />
  28:         <Entity name="list" />
  29:         <Entity name="campaign" />
  30:         <Entity name="campaignactivity" />
  31:         <Entity name="campaignresponse" />
  32:         <Entity name="incident" />
  33:         <!-- Case -->
  34:         <Entity name="quote" />
  35:         <Entity name="salesorder" />
  36:         <!-- Order -->
  37:         <Entity name="invoice" />
  38:         <!-- Custom Entities -->
  39:         <!-- <Entity name="new_myentity"/> -->
  40:         <!-- End Custom Entities -->
  41:       </Entities>
  42:       <!-- Microsoft Customer Relationship Management Service Management Customization -->
  43:       <ServiceManagement>
  44:         <AppointmentBook>
  45:           <SmoothScrollLimit>2000</SmoothScrollLimit>
  46:           <TimeBlocks>
  47:             <!-- All CSS Class mapping for Service activities -->
  48:             <TimeBlock EntityType="4214" StatusCode="1" CssClass="ganttBlockServiceActivityStatus1" />
  49:             <TimeBlock EntityType="4214" StatusCode="2" CssClass="ganttBlockServiceActivityStatus2" />
  50:             <TimeBlock EntityType="4214" StatusCode="3" CssClass="ganttBlockServiceActivityStatus3" />
  51:             <TimeBlock EntityType="4214" StatusCode="4" CssClass="ganttBlockServiceActivityStatus4" />
  52:             <TimeBlock EntityType="4214" StatusCode="6" CssClass="ganttBlockServiceActivityStatus6" />
  53:             <TimeBlock EntityType="4214" StatusCode="7" CssClass="ganttBlockServiceActivityStatus7" />
  54:             <TimeBlock EntityType="4214" StatusCode="8" CssClass="ganttBlockServiceActivityStatus8" />
  55:             <TimeBlock EntityType="4214" StatusCode="9" CssClass="ganttBlockServiceActivityStatus9" />
  56:             <TimeBlock EntityType="4214" StatusCode="10" CssClass="ganttBlockServiceActivityStatus10" />
  57:             <!-- All CSS Class mapping for Appointments -->
  58:             <TimeBlock EntityType="4201" StatusCode="1" CssClass="ganttBlockAppointmentStatus1" />
  59:             <TimeBlock EntityType="4201" StatusCode="2" CssClass="ganttBlockAppointmentStatus2" />
  60:             <TimeBlock EntityType="4201" StatusCode="3" CssClass="ganttBlockAppointmentStatus3" />
  61:             <TimeBlock EntityType="4201" StatusCode="4" CssClass="ganttBlockAppointmentStatus4" />
  62:             <TimeBlock EntityType="4201" StatusCode="5" CssClass="ganttBlockAppointmentStatus5" />
  63:             <TimeBlock EntityType="4201" StatusCode="6" CssClass="ganttBlockAppointmentStatus6" />
  64:           </TimeBlocks>
  65:         </AppointmentBook>
  66:       </ServiceManagement>
  67:     </configuration>
  68:   </IsvConfig>
  69:   <EntityMaps />
  70:   <EntityRelationships />
  71:   <Languages>
  72:     <Language>1033</Language>
  73:   </Languages>
  74: </ImportExportXml>
4. Line 16 is the Line you need to edit.  Replace The Number 2 with your Entity ID. (1 is Accounts and 2 is Contacts. The in the {Brackets} is where your Workflow GUID Goes.  

launchOnDemandWorkflowForm('', '2','{1A4E2305-9019-44CB-B879-49C74632DA2E}');

5. Import the XML File into CRM.

You will now have a form that looks like this:

image

Clicking on the “Create Portal Login” Button will give your users a Prompt like this:

image

You will now see that Workflow in motion. While it only saves a few steps, it makes things a little easier for your end users.


Happy Demo’s!

Tags:

Demo Tools

0

Fixing the Customer Portal and Partner Portal in the latest VPC

by benvollmer 17. July 2010 00:45

The Demo team has been working their backside off and re-released a new VPC image that has some very slick features in it around a Minimal CRM Foot print Profile that runs just CRM and SQL and runs in about a 1.5G of RAM.

The current VPC from April of ’09 expires on August 11th of this year and this new one will not expire until August 12th 2011. So it gives a little while longer.

You can download it from PartnerSource by clicking here. https://mbs.microsoft.com/partnersource/deployment/methodology/vpc/msdcrm4vpcrerelease.htm?printpage=false

When starting the image, the Customer and Partner Portal didn’t work for me.  So I wrote a little script that copies the correct MetaBase.XML to IIS and resets IIS.  Click here to download it.

Hope this works for you!

Ben

Tags:

Demo Tools

0

Date Math in Microsoft Dynamics CRM

by BenVollmer 28. May 2010 21:08

image In case you haven’t noticed, handling dates in JScript is less than ideal. In the book I keep here at my side, there is easily two chapters on handling dates in JScript. (Mind you, not CRM, just regular old JScript.) And then throw doing some math on dates, and it hates you. And you can burn some time in trying to troubleshoot everything.

For a demo, we wanted to take a start date, add a number of days to it and then automatically create the end date. And several hours later, I called my “LifelineChet Kloss from Michigan. In about 10 minutes Chet had my code fixed up.

It turns out in the last Variable, I failed to tell JScript this was a date, which threw it in a bit of a tizzy. So Chet fixed that for me and low and behold, it actually works.

The trick for me at least was converting the number of days into Milliseconds, which is the least common denominator in JScript.

So in the OnChange of Number of Days this was put in the OnChange

var Days = parseInt(crmForm.all.new_numberofdays.DataValue);
var Start = crmForm.all.new_startdate.DataValue;
var Hours = Days * 24;
var Minutes = Hours * 60;
var Seconds = Minutes * 60;
var Milliseconds = Seconds * 1000;
var Finish =  new Date(Start.getTime() + Milliseconds);
crmForm.all.new_enddate.DataValue =Finish;

In the OnChange of Start Date the following Code was placed

crmForm.all.new_numberofdays.FireOnChange();

And in the OnSave Event for the Form, the following code was used:

crmForm.all.new_enddate.ForceSubmit = true;

Tags: ,

Demo Tools

3

Want to add a little sizzle to your demo? How about showing Windows Phone 7 and Microsoft Dynamics CRM?

by benvollmer 18. May 2010 04:40

I am preparing for a demo next week and walking a partner through a bunch of different options to show the prospect CRM on a Mobile Device. The problem is we will be doing a LiveMeeting, so showing the demo on a live client isn’t going to work.

So enter Windows Phone 7. We have a great emulator for the device. If you want to get it, you can download it from here.

It includes Visual Studio 2010 Express for Windows Phone, which is overkill for what we need, but it is included in our download.

Once we get the emulator downloaded and installed. (It will take a few minutes and may involve a reboot.) the following steps are all that is required:

Browse to C:\Program Files (x86)\Microsoft XDE\1.0.

Hold right shift key and then click on right mouse button.

Now click on “open command windows here” option from the menu.

Type this in the command window. (Or Copy if you are lazy like I am.)

xde.exe “C:\Program Files (x86)\Microsoft SDKs\WindowsPhone\v7.0\Emulation\Images\WM70C1.bin”

You now will have the complete emulator up. Now just browse to your favorite mobile CRM site and you now have CRM running on your Windows Phone 7 Emulator.

The Main Screen

image

Selecting from the list of available views.

image

Adding a new account:

image

An extra Kudo to the first person to tell me what car is in the background of photo #3.

 

Happy Demo’ing!

Tags:

Demo Tools

1

Update: Inserting City and State Automatically into Microsoft Dynamics CRM

by BenVollmer 7. May 2010 00:21

It is really hard to believe that I have been blogging for this long. And it is funny how things change. And some things stay the same. So about 4 years ago, I wrote a blog article on using Yahoo’s Web Services to get the City and State based upon a Zip Code Entry.

In talking with one of my co-workers about a demo she was doing, I recommended she look at it as a way to show how we can interface with external systems. Well guess what, Yahoo changed their API’s all around.

So now you need to get an application key for Yahoo and change your URL’s.  So if you want to use this code:

1. Visit https://developer.apps.yahoo.com/

2. Create a Anonymous Project.

3. Get your Key

4. Insert your key in the first line of code below.

5. Place this on the OnChange Event for the Zip Code Field for either the contact or account entity.

 

Enjoy!

 

Ben

var sUrl = http://local.yahooapis.com/MapsService/V1/geocode?appid=INSERT YOUR APP ID HERE!!!;
sUrl += "&zip=" + crmForm.all.address1_postalcode.DataValue;
var oXmlHTTP = new ActiveXObject("Msxml2.XMLHTTP");
oXmlHTTP.Open("GET", sUrl, false);
oXmlHTTP.Send();
var oXmlDoc = oXmlHTTP.responseXML;
crmForm.all.address1_line1.DataValue = oXmlDoc.selectSingleNode("ResultSet/Result/Address").text
crmForm.all.address1_city.DataValue = oXmlDoc.selectSingleNode("ResultSet/Result/City").text
crmForm.all.address1_stateorprovince.DataValue = oXmlDoc.selectSingleNode("ResultSet/Result/State").text
crmForm.all.address1_country.DataValue = oXmlDoc.selectSingleNode("ResultSet/Result/Country").text

Tags: , , ,

Demo Tools

0

Integration using iFrames

by benvollmer 30. April 2010 20:18

image

Have you ever wanted Data in CRM, but you wanted to leverage business logic found in another system you already have in place?

With very little work, you are able to move data from a HTML Page or ASPX page in an iFrame to the main CRM form. This allows for some interesting data integration scenarios.

The scenario here is there is an internal credit application that assigned a score based upon a number of different items in other internal systems. It then posted a credit score to each account. That data needs to be imported into the CRM system, but doing a traditional data import would be difficult and time consuming. And wouldn’t allow for the end user to make changes to the form and have the reflected in the other system until you saved the record.

So we render the credit score for each account in an iFrame in CRM and have the value from the HTML Page put back on the CRM form.

Here is the original form before anything is clicked.

Here it is after clicking on the Save Credit Score and Approve Credit Buttons.

 

The example below contains an entire html page that can be used as an iFrame target. The example contains three methods.

The first function is taking the value from a text field and putting it back into a field new_iframeresponse on the CRM Form.

function Button1_onclick() {

var oCrmForm = parent.document.forms[0];

if (oCrmForm) {

oCrmForm.all.new_iframeresponse.DataValue = document.all["Text1"].value;

oCrmForm.Save();

}

}

The second function is toggling the selected value of a drop down field new_iframeresponsecode on the CRM Form.

function Button2_onclick() {

var oCrmForm = parent.document.forms[0];

if (oCrmForm) {

if(oCrmForm.all.new_iframeresponsecode.DataValue == 1) {

oCrmForm.all.new_iframeresponsecode.DataValue = 2;

}

else {

oCrmForm.all.new_iframeresponsecode.DataValue = 1;

}

}

}

The third function simply reloads the CRM Form.

function Button3_onclick() {

parent.window.location.reload();

}

The coolest part of this code to me is:

var oCrmForm = parent.document.forms[0];

Which is how we would address the CRM Form. So with out the variable, which would look like:

parent.document.forms[0].all.new_iframeresponse.DataValue =

As opposed to method inside the CRM Form itself:

crmForm.all.new_iframeresponse.DataValue =

So if you want to play with this yourself, you can download the attachment here and install on your DEMO box. To install:

  1. Create Two Field – One Called iFrameResponseCode and make it a Picklist. Add Two Items to it, Approved and Deadbeat. The second field is called iFrameResponse which is used to store the credit score.
  2. Copy the HTML File into the ISV directory
  3. Point the iFrame to the HTML File.

Enjoy!

Click Here to Download the Source Code

Tags:

Demo Tools

1

Selecting Account Address for a Contact

by benvollmer 29. April 2010 18:50

How often have you had an account that has had a number of different addresses and you want to be able to use that address at the contact record?

image

image

 

This little HTML File written by Pierre-Adrien Forestier from Microsoft France. It is really as simple as copying this to an iFrame and unchecking “Restrict Cross Frame Scripting.”

 

image

 

And again the trick here is to have the iFrame refresh when you change the Parent Account. So on the Parent Account Field, put the following as an OnChange Event:

crmForm.all.IFRAME_MoreAddresses.src = crmForm.all.IFRAME_MoreAddresses.src;

That of course assumes that your iFrame is called MoreAddresses and it is in the ISV Directory.

Happy Demo’ing.

Download the Source Code here.

Tags:

Demo Tools

8

Getting Customer Temperature

by benvollmer 26. April 2010 19:23

How often have you pulled open a CRM Record and wanted to VERY quickly see the temperature of the customer? For a customer the other day, I did a quick mock up of how you could do this. I have seen it done a number of ways over the years, but all of them have been less than ideal from a support perspective. (They either modify the DHTML of CRM’s Forms in a section or where embedded into the header of CRM, both of which would be unsupported.)

image

In order to accomplish this magic, you only need to do two things. One is copy the enclosed file to the ISV Directory and point an iFrame to it. In this example, we are using the customer satisfaction picklist in the Case Entity.

image

 

On the Customer Satisfaction Entity, we want to put the following in the OnChange Event. Using this allows the iFrame to be refreshed anytime the customer satisfaction field is changed. (The other option would be to put a refresh inside the CaseUpdate.HTML file.) 

crmForm.all.IFRAME_tempature.src = crmForm.all.IFRAME_tempature.src;

image 

 

Happy Demo’ing!

Download the Source Code Here.

Tags:

Demo Tools

2

xRM and ICC VPC Released to Partners

by benvollmer 4. November 2009 22:47

You can find your copy on PartnerSource. Login to PartnerSource, Click on Sales, Under Demo Tools and then Click on VPC. In that list, you will find the Integrated Call Center Demo VPC and the xRM Demo VPC.

The Microsoft Dynamics CRM Integrated Contact Center Demonstration VPC has been released for Dynamics Partners to use. This VPC is built upon the April 2009 VPC and has significant features around a Contact Center including CTI Bar and Ribbon for Contact Agent.

The xRM Demo VPC is built upon the Microsoft Dynamics CRM April 2009 VPC and contains three applications, Vendor Management, Facilities Management and Employee Management. These three applications demonstrate the capability of the Microsoft Dynamics CRM platform to serve the needs of more than Sales, Service and Marketing. It also includes Contoso, which makes demo’ing xRM and CRM at the same time much easier.

Tags:

Demo Tools

Powered by BlogEngine.NET 1.6.1.0
Original Design by Laptop Geek, Adapted by onesoft