Thursday, August 30, 2012

Check Out the Dynamics CRM Optionset Community Library

I found out yesterday that a couple other MVP's put together a community optionset import tool and community library of freely available optionsets.  Tanguy Touzard and Jerry Weinstock are to thank for this one.  I recommend checking out the free tool and optionsets out there.  Also, feel free to contribute your optionsets to the library.

http://www.crmoptionset.com/

- Happy Thursday!

Tuesday, August 28, 2012

List of Currencies Included With Microsoft Dynamics CRM 2011 in XML Format

I got asked the question how to get at the list of currencies in CRM programmatically.  I looked everywhere and couldn't find them in the org or server database.  I see where it's calling a saved query against some .NET API that is buried in the program.  If anyone wants an easy way to access them in a program, here they are in XML format with their codes, precisions, symbols, etc...  It doesn't look like you get it very easily at all programmatically.

This is the out of the box list. Remember, you can also add your own user defined currencies in case you made something up  like "MileyBucks" in your own little world :)

<DocumentElement><currency><regionname>Afghanistan</regionname><currencyname>افغانى</currencyname><isocurrencycode>AFN</isocurrencycode><currencysymbol>؋</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Albania</regionname><currencyname>Lek</currencyname><isocurrencycode>ALL</isocurrencycode><currencysymbol>Lek</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Algeria</regionname><currencyname>Dinar</currencyname><isocurrencycode>DZD</isocurrencycode><currencysymbol>DZD</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Algeria</regionname><currencyname>دينار جزائري</currencyname><isocurrencycode>DZD</isocurrencycode><currencysymbol>د.ج.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Argentina</regionname><currencyname>Peso</currencyname><isocurrencycode>ARS</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Armenia</regionname><currencyname>դրամ</currencyname><isocurrencycode>AMD</isocurrencycode><currencysymbol>դր.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Australia</regionname><currencyname>Australian Dollar</currencyname><isocurrencycode>AUD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Austria</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Azerbaijan</regionname><currencyname>manat</currencyname><isocurrencycode>AZN</isocurrencycode><currencysymbol>man.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Azerbaijan</regionname><currencyname>рубль</currencyname><isocurrencycode>AZN</isocurrencycode><currencysymbol>ман.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Bahrain</regionname><currencyname>دينار بحريني</currencyname><isocurrencycode>BHD</isocurrencycode><currencysymbol>د.ب.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Bangladesh</regionname><currencyname>টাকা</currencyname><isocurrencycode>BDT</isocurrencycode><currencysymbol>৳</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Belarus</regionname><currencyname>рубль</currencyname><isocurrencycode>BYR</isocurrencycode><currencysymbol>р.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Belgium</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Belize</regionname><currencyname>Belize Dollar</currencyname><isocurrencycode>BZD</isocurrencycode><currencysymbol>BZ$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Bolivarian Republic of Venezuela</regionname><currencyname>Bolívar</currencyname><isocurrencycode>VEF</isocurrencycode><currencysymbol>Bs. F.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Bolivia</regionname><currencyname>Boliviano</currencyname><isocurrencycode>BOB</isocurrencycode><currencysymbol>$b</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Bosnia and Herzegovina</regionname><currencyname>konvertibilna marka</currencyname><isocurrencycode>BAM</isocurrencycode><currencysymbol>KM</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Bosnia and Herzegovina</regionname><currencyname>конвертибилна марка</currencyname><isocurrencycode>BAM</isocurrencycode><currencysymbol>КМ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Brazil</regionname><currencyname>Real</currencyname><isocurrencycode>BRL</isocurrencycode><currencysymbol>R$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Brunei Darussalam</regionname><currencyname>Ringgit</currencyname><isocurrencycode>BND</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Bulgaria</regionname><currencyname>България лев</currencyname><isocurrencycode>BGN</isocurrencycode><currencysymbol>лв.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Cambodia</regionname><currencyname>x179Aៀល</currencyname><isocurrencycode>KHR</isocurrencycode><currencysymbol>៛</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Canada</regionname><currencyname>ᑲᓇᑕᐅᑉ ᑮᓇᐅᔭᖓ</currencyname><isocurrencycode>CAD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Canada</regionname><currencyname>Canadian Dollar</currencyname><isocurrencycode>CAD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Canada</regionname><currencyname>Kanataup Kiinaujanga;</currencyname><isocurrencycode>CAD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Canada</regionname><currencyname>Dollar canadien</currencyname><isocurrencycode>CAD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Caribbean</regionname><currencyname>US Dollar</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Chile</regionname><currencyname>Peso</currencyname><isocurrencycode>CLP</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Colombia</regionname><currencyname>Peso</currencyname><isocurrencycode>COP</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Costa Rica</regionname><currencyname>Colón</currencyname><isocurrencycode>CRC</isocurrencycode><currencysymbol>₡</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Croatia</regionname><currencyname>hrvatska kuna</currencyname><isocurrencycode>HRK</isocurrencycode><currencysymbol>kn</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Czech Republic</regionname><currencyname>Koruna Česká</currencyname><isocurrencycode>CZK</isocurrencycode><currencysymbol>Kč</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Denmark</regionname><currencyname>Dansk krone</currencyname><isocurrencycode>DKK</isocurrencycode><currencysymbol>kr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Dominican Republic</regionname><currencyname>Peso</currencyname><isocurrencycode>DOP</isocurrencycode><currencysymbol>RD$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Ecuador</regionname><currencyname>US Dolar</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Egypt</regionname><currencyname>جنيه مصري</currencyname><isocurrencycode>EGP</isocurrencycode><currencysymbol>ج.م.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>El Salvador</regionname><currencyname>US Dolar</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Estonia</regionname><currencyname>Kroon</currencyname><isocurrencycode>EEK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Ethiopia</regionname><currencyname>ብር</currencyname><isocurrencycode>ETB</isocurrencycode><currencysymbol>ETB</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Faroe Islands</regionname><currencyname>Dansk krone</currencyname><isocurrencycode>DKK</isocurrencycode><currencysymbol>kr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Finland</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Finland</regionname><currencyname>evro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>France</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Georgia</regionname><currencyname>ლარი</currencyname><isocurrencycode>GEL</isocurrencycode><currencysymbol>Lari</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Germany</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Greece</regionname><currencyname>ευρώ</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Greenland</regionname><currencyname>korunni</currencyname><isocurrencycode>DKK</isocurrencycode><currencysymbol>kr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Guatemala</regionname><currencyname>Quetzal</currencyname><isocurrencycode>GTQ</isocurrencycode><currencysymbol>Q</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Honduras</regionname><currencyname>Lempira</currencyname><isocurrencycode>HNL</isocurrencycode><currencysymbol>L.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Hong Kong S.A.R.</regionname><currencyname>港幣</currencyname><isocurrencycode>HKD</isocurrencycode><currencysymbol>HK$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Hungary</regionname><currencyname>forint</currencyname><isocurrencycode>HUF</isocurrencycode><currencysymbol>Ft</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Iceland</regionname><currencyname>Króna</currencyname><isocurrencycode>ISK</isocurrencycode><currencysymbol>kr.</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>India</regionname><currencyname>रुपया</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>रु</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>টাকা</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>টা</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>ਰੁਪਿਆ</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ਰੁ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>રૂપિયો</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>રૂ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>ଟଙ୍କା</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ଟ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>ரூபாய்</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ரூ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>రూపాయి</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>రూ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>ರೂಪಾಯಿ</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ರೂ</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>രൂപ</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ക</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>টকা</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>ট</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>रु्यकम्</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>रु</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>रुपय</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>रु</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>India</regionname><currencyname>Rupee;</currencyname><isocurrencycode>INR</isocurrencycode><currencysymbol>Rs.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Indonesia</regionname><currencyname>Rupiah</currencyname><isocurrencycode>IDR</isocurrencycode><currencysymbol>Rp</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Iran</regionname><currencyname>رىال</currencyname><isocurrencycode>IRR</isocurrencycode><currencysymbol>ريال</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Iraq</regionname><currencyname>دينار عراقي</currencyname><isocurrencycode>IQD</isocurrencycode><currencysymbol>د.ع.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Ireland</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Islamic Republic of Pakistan</regionname><currencyname>روپيه</currencyname><isocurrencycode>PKR</isocurrencycode><currencysymbol>Rs</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Israel</regionname><currencyname>שקל חדש</currencyname><isocurrencycode>ILS</isocurrencycode><currencysymbol>₪</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Italy</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Jamaica</regionname><currencyname>Jamaican Dollar</currencyname><isocurrencycode>JMD</isocurrencycode><currencysymbol>J$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Japan</regionname><currencyname>円</currencyname><isocurrencycode>JPY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Jordan</regionname><currencyname>دينار اردني</currencyname><isocurrencycode>JOD</isocurrencycode><currencysymbol>د.ا.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Kazakhstan</regionname><currencyname>Т</currencyname><isocurrencycode>KZT</isocurrencycode><currencysymbol>Т</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Kenya</regionname><currencyname>Shilingi</currencyname><isocurrencycode>KES</isocurrencycode><currencysymbol>S</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Korea</regionname><currencyname>원</currencyname><isocurrencycode>KRW</isocurrencycode><currencysymbol>₩</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Kuwait</regionname><currencyname>دينار كويتي</currencyname><isocurrencycode>KWD</isocurrencycode><currencysymbol>د.ك.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Kyrgyzstan</regionname><currencyname>сом</currencyname><isocurrencycode>KGS</isocurrencycode><currencysymbol>сом</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Lao P.D.R.</regionname><currencyname>ກີບ</currencyname><isocurrencycode>LAK</isocurrencycode><currencysymbol>₭</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Latvia</regionname><currencyname>Lats</currencyname><isocurrencycode>LVL</isocurrencycode><currencysymbol>Ls</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Lebanon</regionname><currencyname>ليرة لبناني</currencyname><isocurrencycode>LBP</isocurrencycode><currencysymbol>ل.ل.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Libya</regionname><currencyname>دينار ليبي</currencyname><isocurrencycode>LYD</isocurrencycode><currencysymbol>د.ل.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Liechtenstein</regionname><currencyname>Schweizer Franken</currencyname><isocurrencycode>CHF</isocurrencycode><currencysymbol>CHF</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Lithuania</regionname><currencyname>Litas</currencyname><isocurrencycode>LTL</isocurrencycode><currencysymbol>Lt</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Luxembourg</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Luxembourg</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Macao S.A.R.</regionname><currencyname>澳門幣</currencyname><isocurrencycode>MOP</isocurrencycode><currencysymbol>MOP</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Macedonia (FYROM)</regionname><currencyname>денар</currencyname><isocurrencycode>MKD</isocurrencycode><currencysymbol>ден.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Malaysia</regionname><currencyname>Ringgit Malaysia</currencyname><isocurrencycode>MYR</isocurrencycode><currencysymbol>RM</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Malaysia</regionname><currencyname>Malaysian Ringgit</currencyname><isocurrencycode>MYR</isocurrencycode><currencysymbol>RM</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Maldives</regionname><currencyname>ރުފިޔާ</currencyname><isocurrencycode>MVR</isocurrencycode><currencysymbol>ރ.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Malta</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Mexico</regionname><currencyname>Peso</currencyname><isocurrencycode>MXN</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Mongolia</regionname><currencyname>Төгрөг</currencyname><isocurrencycode>MNT</isocurrencycode><currencysymbol>₮</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Montenegro</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Montenegro</regionname><currencyname>Еуро</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Morocco</regionname><currencyname>درهم مغربي</currencyname><isocurrencycode>MAD</isocurrencycode><currencysymbol>د.م.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Nepal</regionname><currencyname>रुपैयाँ</currencyname><isocurrencycode>NPR</isocurrencycode><currencysymbol>रु</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Netherlands</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>New Zealand</regionname><currencyname>tāra</currencyname><isocurrencycode>NZD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>New Zealand</regionname><currencyname>New Zealand Dollar</currencyname><isocurrencycode>NZD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Nicaragua</regionname><currencyname>Córdoba</currencyname><isocurrencycode>NIO</isocurrencycode><currencysymbol>C$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Nigeria</regionname><currencyname>Naira</currencyname><isocurrencycode>NIO</isocurrencycode><currencysymbol>N</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Norway</regionname><currencyname>Norsk krone</currencyname><isocurrencycode>NOK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Norway</regionname><currencyname>kruvdno</currencyname><isocurrencycode>NOK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Norway</regionname><currencyname>kråvnnå</currencyname><isocurrencycode>NOK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Norway</regionname><currencyname>kråvnoe</currencyname><isocurrencycode>NOK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Oman</regionname><currencyname>ريال عماني</currencyname><isocurrencycode>OMR</isocurrencycode><currencysymbol>ر.ع.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Panama</regionname><currencyname>Balboa</currencyname><isocurrencycode>PAB</isocurrencycode><currencysymbol>B/.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Paraguay</regionname><currencyname>Guaraní</currencyname><isocurrencycode>PYG</isocurrencycode><currencysymbol>Gs</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>People's Republic of China</regionname><currencyname>མི་དམངས་ཤོག་སྒོཪ།</currencyname><isocurrencycode>CNY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>People's Republic of China</regionname><currencyname>ꎆꃀ</currencyname><isocurrencycode>CNY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>People's Republic of China</regionname><currencyname>خەلق پۇلى</currencyname><isocurrencycode>CNY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>People's Republic of China</regionname><currencyname>人民币</currencyname><isocurrencycode>CNY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>People's Republic of China</regionname><currencyname>ᠠᠷᠠᠳ  ᠤᠨ ᠵᠤᠭᠤᠰ</currencyname><isocurrencycode>CNY</isocurrencycode><currencysymbol>¥</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Peru</regionname><currencyname>Nuevo Sol</currencyname><isocurrencycode>PEN</isocurrencycode><currencysymbol>S/.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Philippines</regionname><currencyname>Philippine Peso</currencyname><isocurrencycode>PHP</isocurrencycode><currencysymbol>PhP</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Philippines</regionname><currencyname>Philippine Peso</currencyname><isocurrencycode>PHP</isocurrencycode><currencysymbol>Php</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Poland</regionname><currencyname>Złoty</currencyname><isocurrencycode>PLN</isocurrencycode><currencysymbol>zł</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Portugal</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Principality of Monaco</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Puerto Rico</regionname><currencyname>US Dollar</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Qatar</regionname><currencyname>ريال قطري</currencyname><isocurrencycode>QAR</isocurrencycode><currencysymbol>ر.ق.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Romania</regionname><currencyname>Leu</currencyname><isocurrencycode>RON</isocurrencycode><currencysymbol>lei</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Russia</regionname><currencyname>рубль</currencyname><isocurrencycode>RUB</isocurrencycode><currencysymbol>р.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Russia</regionname><currencyname>һум</currencyname><isocurrencycode>RUB</isocurrencycode><currencysymbol>һ.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Russia</regionname><currencyname>солкуобай</currencyname><isocurrencycode>RUB</isocurrencycode><currencysymbol>с.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Rwanda</regionname><currencyname>Ifaranga</currencyname><isocurrencycode>RWF</isocurrencycode><currencysymbol>RWF</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Saudi Arabia</regionname><currencyname>ريال سعودي</currencyname><isocurrencycode>SAR</isocurrencycode><currencysymbol>ر.س.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Senegal</regionname><currencyname>XOF Senegal</currencyname><isocurrencycode>XOF</isocurrencycode><currencysymbol>XOF</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Serbia</regionname><currencyname>dinar</currencyname><isocurrencycode>RSD</isocurrencycode><currencysymbol>Din.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Serbia</regionname><currencyname>динар</currencyname><isocurrencycode>RSD</isocurrencycode><currencysymbol>Дин.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Serbia and Montenegro (Former)</regionname><currencyname>dinar</currencyname><isocurrencycode>CSD</isocurrencycode><currencysymbol>Din.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Serbia and Montenegro (Former)</regionname><currencyname>динар</currencyname><isocurrencycode>CSD</isocurrencycode><currencysymbol>Дин.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Singapore</regionname><currencyname>新币</currencyname><isocurrencycode>SGD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Singapore</regionname><currencyname>Singapore Dollar</currencyname><isocurrencycode>SGD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Slovakia</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Slovenia</regionname><currencyname>Euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>South Africa</regionname><currencyname>Rand</currencyname><isocurrencycode>ZAR</isocurrencycode><currencysymbol>R</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Spain</regionname><currencyname>euro</currencyname><isocurrencycode>EUR</isocurrencycode><currencysymbol>€</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Sri Lanka</regionname><currencyname>රුපියල්</currencyname><isocurrencycode>LKR</isocurrencycode><currencysymbol>රු.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Sweden</regionname><currencyname>Svensk krona</currencyname><isocurrencycode>SEK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Sweden</regionname><currencyname>kruvdno</currencyname><isocurrencycode>SEK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Sweden</regionname><currencyname>kråvnnå</currencyname><isocurrencycode>SEK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Sweden</regionname><currencyname>kråvnoe</currencyname><isocurrencycode>SEK</isocurrencycode><currencysymbol>kr</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Switzerland</regionname><currencyname>Franc svizzer</currencyname><isocurrencycode>CHF</isocurrencycode><currencysymbol>fr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Switzerland</regionname><currencyname>Schweizer Franken</currencyname><isocurrencycode>CHF</isocurrencycode><currencysymbol>Fr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Switzerland</regionname><currencyname>Franco svizzero</currencyname><isocurrencycode>CHF</isocurrencycode><currencysymbol>fr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Switzerland</regionname><currencyname>Franc suisse</currencyname><isocurrencycode>CHF</isocurrencycode><currencysymbol>fr.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Syria</regionname><currencyname>جنيه سوري</currencyname><isocurrencycode>SYP</isocurrencycode><currencysymbol>ل.س.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Syria</regionname><currencyname>ليرة سوري</currencyname><isocurrencycode>SYP</isocurrencycode><currencysymbol>ل.س.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Taiwan</regionname><currencyname>新台幣</currencyname><isocurrencycode>TWD</isocurrencycode><currencysymbol>NT$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Tajikistan</regionname><currencyname>рубл</currencyname><isocurrencycode>TJS</isocurrencycode><currencysymbol>т.р.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Thailand</regionname><currencyname>บาท</currencyname><isocurrencycode>THB</isocurrencycode><currencysymbol>฿</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Trinidad and Tobago</regionname><currencyname>Trinidad Dollar</currencyname><isocurrencycode>TTD</isocurrencycode><currencysymbol>TT$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Tunisia</regionname><currencyname>دينار تونسي</currencyname><isocurrencycode>TND</isocurrencycode><currencysymbol>د.ت.‏</currencysymbol><currencyprecision>3</currencyprecision></currency><currency><regionname>Turkey</regionname><currencyname>Türk Lirası</currencyname><isocurrencycode>TRY</isocurrencycode><currencysymbol>TL</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Turkmenistan</regionname><currencyname>manat</currencyname><isocurrencycode>TMT</isocurrencycode><currencysymbol>m.</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>U.A.E.</regionname><currencyname>درهم اماراتي</currencyname><isocurrencycode>AED</isocurrencycode><currencysymbol>د.إ.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Ukraine</regionname><currencyname>гривня</currencyname><isocurrencycode>UAH</isocurrencycode><currencysymbol>₴</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>United Kingdom</regionname><currencyname>UK Pound Sterling</currencyname><isocurrencycode>GBP</isocurrencycode><currencysymbol>£</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>United Kingdom</regionname><currencyname>Nota Bhreatannach</currencyname><isocurrencycode>GBP</isocurrencycode><currencysymbol>£</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>United Kingdom</regionname><currencyname>Pound Sterling</currencyname><isocurrencycode>GBP</isocurrencycode><currencysymbol>£</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>United States</regionname><currencyname>US Dollar</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>United States</regionname><currencyname>Dólar de EE.UU.</currencyname><isocurrencycode>USD</isocurrencycode><currencysymbol>$</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Uruguay</regionname><currencyname>Peso</currencyname><isocurrencycode>UYU</isocurrencycode><currencysymbol>$U</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Uzbekistan</regionname><currencyname>so‘m</currencyname><isocurrencycode>UZS</isocurrencycode><currencysymbol>so'm</currencysymbol><currencyprecision>0</currencyprecision></currency><currency><regionname>Uzbekistan</regionname><currencyname>сўм</currencyname><isocurrencycode>UZS</isocurrencycode><currencysymbol>сўм</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Vietnam</regionname><currencyname>Đồng</currencyname><isocurrencycode>VND</isocurrencycode><currencysymbol>₫</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Yemen</regionname><currencyname>ريال يمني</currencyname><isocurrencycode>YER</isocurrencycode><currencysymbol>ر.ي.‏</currencysymbol><currencyprecision>2</currencyprecision></currency><currency><regionname>Zimbabwe</regionname><currencyname>Zimbabwe Dollar</currencyname><isocurrencycode>ZWL</isocurrencycode><currencysymbol>Z$</currencysymbol><currencyprecision>2</currencyprecision></currency></DocumentElement>

- Hopefully it helps someone.

-

Monday, August 27, 2012

Hmm... Maybe I Should Go "Dark" For Awhile.

Ok, there is very little new that I can in .NET 4.5 and Visual Studio 2012 from a code standpoint apart from the new metro stuff concerning Javascript and HTML 5  (all the Windows 8 goodness), but gosh darn it I love this interface.  I first fired it up and thought was absolutely sterile and kinda lame, but then I found out I could go Tools - Options - Environment - General and change my Color Theme to Dark.

I don't know if I can ever go back to Visual Studio 2010.  The other really helpful feature I have found for you people with more than one monitor is Rafting.



Friday, August 24, 2012

Microsoft Dynamics CRM 2011 Compatibility With .NET 4.5

I have been doing some tests lately and have had a lot of luck recently with .NET 4.5 being compatible with Microsoft Dynamics CRM 2011.  I haven't run into an unsuccessful scenario yet but I am wondering if anyone else in the community has.

According to this KB article it seems to be compatible since Update Rollup 8:
http://support.microsoft.com/kb/2669061

Here is what I have tried so far and all of these worked:

  • Creating applications that talk to CRM compiled in 4.5 that reference the 4.0 assemblies included with the SDK
  •  Registering 4.5 compiled plugins using the plugin registration tool (also recompiled to 4.5).
  • Using new .NET 4.5 functionality in plugins (required 4.5 framework to be installed on server and a server reboot)

Interestingly enough my first .NET 4.5 plugin fired successfully even though .NET 4.5 wasn't installed on the CRM server.  You only need the 4.5 framework installed if you use new 4.5 functionality.  When I added some new code functionality in my plugin it did fail on that line of code until I installed the 4.5 framework on the server and rebooted.  That fixed the issue and the plugin fired normally.

I am wondering if anyone has found anything that doesn't work so far?  Let me know!

-Happy Friday!

Wednesday, August 22, 2012

Query a User's Schedule for Open Time Slots Using VB.NET in Microsoft Dynamics CRM 2011

This illustration shows how to query a user's schedule for open time blocks using VB.NET  in Microsoft Dynamics CRM 2011 with QueryScheduleRequest.
    Ok, here is what the code looks like!
    In VB.NET

    Dim reqWAI As New WhoAmIRequest()
    Dim respWAI As WhoAmIResponse = DirectCast(_serviceProxy.Execute(reqWAI), WhoAmIResponse)
    
    Dim reqSchedule As New QueryScheduleRequest()
    reqSchedule.ResourceId = respWAI.UserId
    reqSchedule.Start = DateTime.Now
    reqSchedule.End = DateTime.Today.AddDays(3)
    Dim tmc As New TimeCode()
    tmc = TimeCode.Available
    reqSchedule.TimeCodes = New TimeCode() {TimeCode.Available}
    
    Dim respSchedule As QueryScheduleResponse = DirectCast(slos.Execute(reqSchedule), QueryScheduleResponse)
    
    If respSchedule.TimeInfos.Length > 0 Then
        'act on timeslots
    Else
        'user has no free time that meets these parameters
    End If
    
    

    If you need help instantiating a service object in .NET within a plugin check out this post:
    http://mileyja.blogspot.com/2011/04/instantiating-service-object-within.html

    I hope this helps!
    -

    Monday, August 20, 2012

    Query a User's Schedule for Open Time Blocks Using .NET and Jscript in Microsoft Dynamics CRM 2011

    This illustration shows how to query a user's schedule for open time blocks using C# or Jscript in Microsoft Dynamics CRM 2011 with QueryScheduleRequest.
      Ok, here is what the code looks like!
      First in C#:

       WhoAmIRequest reqWAI = new WhoAmIRequest();
       WhoAmIResponse respWAI = (WhoAmIResponse)_serviceProxy.Execute(reqWAI);
      
                                                    
       QueryScheduleRequest reqSchedule = new QueryScheduleRequest();
       reqSchedule.ResourceId = respWAI.UserId;
       reqSchedule.Start = DateTime.Now;
       reqSchedule.End = DateTime.Today.AddDays(3);
       reqSchedule.TimeCodes = new TimeCode[] { TimeCode.Available };
      
       QueryScheduleResponse respSchedule = (QueryScheduleResponse)service.Execute(reqSchedule);
      
       
       if (respSchedule.TimeInfos.Length > 0)
       {
           //act on time slots
       }
      

      If you need help instantiating a service object in .NET within a plugin check out this post:
      http://mileyja.blogspot.com/2011/04/instantiating-service-object-within.html

      Now here is the Jscript nicely formatted by the CRM 2011 SOAP formatter. Available at: http://crm2011soap.codeplex.com/

      Now in Jscript


      This example is asynchronous, if you want to learn how to make JScript SOAP calls synchronously please visit this posthttp://mileyja.blogspot.com/2011/07/using-jscript-to-access-soap-web.html

      
      if (typeof (SDK) == "undefined")
         { SDK = { __namespace: true }; }
             //This will establish a more unique namespace for functions in this library. This will reduce the 
             // potential for functions to be overwritten due to a duplicate name when the library is loaded.
             SDK.SAMPLES = {
                 _getServerUrl: function () {
                     ///<summary>
                     /// Returns the URL for the SOAP endpoint using the context information available in the form
                     /// or HTML Web resource.
                     ///</summary>
                     var ServicePath = "/XRMServices/2011/Organization.svc/web";
                     var serverUrl = "";
                     if (typeof GetGlobalContext == "function") {
                         var context = GetGlobalContext();
                         serverUrl = context.getServerUrl();
                     }
                     else {
                         if (typeof Xrm.Page.context == "object") {
                               serverUrl = Xrm.Page.context.getServerUrl();
                         }
                         else
                         { throw new Error("Unable to access the server URL"); }
                         }
                        if (serverUrl.match(/\/$/)) {
                             serverUrl = serverUrl.substring(0, serverUrl.length - 1);
                         } 
                         return serverUrl + ServicePath;
                     }, 
                 QueryScheduleRequest: function () {
                     var requestMain = ""
                     requestMain += "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">";
                     requestMain += "  <s:Body>";
                     requestMain += "    <Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">";
                     requestMain += "      <request i:type=\"b:QueryScheduleRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\" xmlns:b=\"http://schemas.microsoft.com/crm/2011/Contracts\">";
                     requestMain += "        <a:Parameters xmlns:c=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">";
                     requestMain += "          <a:KeyValuePairOfstringanyType>";
                     requestMain += "            <c:key>ResourceId</c:key>";
                     requestMain += "            <c:value i:type=\"d:guid\" xmlns:d=\"http://schemas.microsoft.com/2003/10/Serialization/\">6e219f51-0310-4c4d-8c60-1c524e2ba7b3</c:value>";
                     requestMain += "          </a:KeyValuePairOfstringanyType>";
                     requestMain += "          <a:KeyValuePairOfstringanyType>";
                     requestMain += "            <c:key>Start</c:key>";
                     requestMain += "            <c:value i:type=\"d:dateTime\" xmlns:d=\"http://www.w3.org/2001/XMLSchema\">2012-08-20T10:10:38.910063-05:00</c:value>";
                     requestMain += "          </a:KeyValuePairOfstringanyType>";
                     requestMain += "          <a:KeyValuePairOfstringanyType>";
                     requestMain += "            <c:key>End</c:key>";
                     requestMain += "            <c:value i:type=\"d:dateTime\" xmlns:d=\"http://www.w3.org/2001/XMLSchema\">2012-08-23T00:00:00-05:00</c:value>";
                     requestMain += "          </a:KeyValuePairOfstringanyType>";
                     requestMain += "          <a:KeyValuePairOfstringanyType>";
                     requestMain += "            <c:key>TimeCodes</c:key>";
                     requestMain += "            <c:value i:type=\"b:ArrayOfTimeCode\">";
                     requestMain += "              <b:TimeCode>Available</b:TimeCode>";
                     requestMain += "            </c:value>";
                     requestMain += "          </a:KeyValuePairOfstringanyType>";
                     requestMain += "        </a:Parameters>";
                     requestMain += "        <a:RequestId i:nil=\"true\" />";
                     requestMain += "        <a:RequestName>QuerySchedule</a:RequestName>";
                     requestMain += "      </request>";
                     requestMain += "    </Execute>";
                     requestMain += "  </s:Body>";
                     requestMain += "</s:Envelope>";
                     var req = new XMLHttpRequest();
                     req.open("POST", SDK.SAMPLES._getServerUrl(), true)
                     req.setRequestHeader("Accept", "application/xml, text/xml, */*");
                     req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
                     req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
                     var successCallback = null;
                     var errorCallback = null;
                     req.onreadystatechange = function () { SDK.SAMPLES.QueryScheduleResponse(req, successCallback, errorCallback); };
                     req.send(requestMain);
                 },
             QueryScheduleResponse: function (req, successCallback, errorCallback) {
                     ///<summary>
                     /// Recieves the assign response
                     ///</summary>
                     ///<param name="req" Type="XMLHttpRequest">
                     /// The XMLHttpRequest response
                     ///</param>
                     ///<param name="successCallback" Type="Function">
                     /// The function to perform when an successfult response is returned.
                     /// For this message no data is returned so a success callback is not really necessary.
                     ///</param>
                     ///<param name="errorCallback" Type="Function">
                     /// The function to perform when an error is returned.
                     /// This function accepts a JScript error returned by the _getError function
                     ///</param>
                     if (req.readyState == 4) {
                     if (req.status == 200) {
                     if (successCallback != null)
                     { successCallback(); }
                     }
                     else {
                         errorCallback(SDK.SAMPLES._getError(req.responseXML));
                     }
                 }
             },
             _getError: function (faultXml) {
                 ///<summary>
                 /// Parses the WCF fault returned in the event of an error.
                 ///</summary>
                 ///<param name="faultXml" Type="XML">
                 /// The responseXML property of the XMLHttpRequest response.
                 ///</param>
                 var errorMessage = "Unknown Error (Unable to parse the fault)";
                 if (typeof faultXml == "object") {
                     try {
                         var bodyNode = faultXml.firstChild.firstChild;
                         //Retrieve the fault node
                         for (var i = 0; i < bodyNode.childNodes.length; i++) {
                             var node = bodyNode.childNodes[i];
                             //NOTE: This comparison does not handle the case where the XML namespace changes
                             if ("s:Fault" == node.nodeName) {
                             for (var j = 0; j < node.childNodes.length; j++) {
                                 var faultStringNode = node.childNodes[j];
                                 if ("faultstring" == faultStringNode.nodeName) {
                                     errorMessage = faultStringNode.text;
                                     break;
                                 }
                             }
                             break;
                         }
                     }
                 }
                 catch (e) { };
              }
              return new Error(errorMessage);
           },
       __namespace: true
      };
      
      


      To understand how to parse the response please review my post on using the DOM parser.
      Now you can call the SDK.SAMPLES.QueryScheduleRequest function from your form jscript handler.


      Thats all there is to it!
      -

      Friday, August 17, 2012

      Any Volunteers for CRM 2011 Community Project

      I am planning to build a CodePlex project to speed up XRM development of apps and make apps much easier to port to CRM 2011.  If a developer type that would love to help out, please contact me on my about me page or shoot me a note on Linked IN.

      - Thanks!

      MSDN Just Released Windows 8 RTM and Visual Studio 2012 RTM

      In case anyone hasn't noticed, yesterday MSDN released Visual Studio 2012 RTM and Windows 8 RTM.  So if you have an  MSDN license I highly recommend going out and checking them out.

      - Hope that makes for a happy Friday!

      Friday, August 10, 2012

      A New Blog You Might be Interested in If You Use Dynamics CRM Online


      If you have Dynamics CRM Online or are an implementer of Dynamics CRM Online you might want to follow this new blog that has just been started by the product team.

      I just wanted to drop a quick note that the Dynamics CRM Online Blog is now live: https://community.dynamics.com/product/crm/crmtechnical/b/crmonlineservice/archive/2012/08/09/welcome-to-the-microsoft-dynamics-crm-online-service-blog.aspx.

      Have a great day!

      Wednesday, August 8, 2012

      Query Audit Data in Microsoft Dynamics CRM 2011 to Determine When A User Last Logged In

      This example will show you how to Query audit data in .NET (C#) and Jscript to determine when a user last logged in to the system.

      Important Notes: The way access auditing currently works in CRM it will only record access to the system every 4 hours for someone.  So you can tell when someone logged in, but you won't be able to tell when they logged in again unless the subsequent login was more than four hours later.  Also, access auditing wasn't added to CRM 2011 until Update Rollup 5.  So you need to have CRM Online or On-Premise with at least Update Rollup 5 installed to use access auditing.

      C# Example: 


      RetrieveMultipleRequest rmr = new RetrieveMultipleRequest();
      RetrieveMultipleResponse resp = new RetrieveMultipleResponse();
      SystemUser wr = new SystemUser();
      
      QueryExpression query = new QueryExpression()
      {
          EntityName = "audit",
          ColumnSet = new ColumnSet(true),
          Criteria = new FilterExpression
          {
              FilterOperator = LogicalOperator.And,
              Conditions = 
                {
                    new ConditionExpression
                    {
                        AttributeName = "operation",
                        Operator = ConditionOperator.Equal,
                        Values = { 4 }  //access
                    },
                    new ConditionExpression
                    {
                        AttributeName = "objectid",
                        Operator = ConditionOperator.Equal,
                        Values = { "6e219f51-0310-4c4d-8c60-1c524e2ba7b3" }  //my user id
                    }
                
                //
                }
      
      
          },
          Orders = 
          {
              new OrderExpression
              {
                  AttributeName = "createdon",
                  OrderType = OrderType.Descending
              }
          }
      };
      
      rmr.Query = query;
      resp = (RetrieveMultipleResponse)slos.Execute(rmr);
      
      

      Now in J-SCRIPT :

      
      if (typeof (SDK) == "undefined")
         { SDK = { __namespace: true }; }
             //This will establish a more unique namespace for functions in this library. This will reduce the 
             // potential for functions to be overwritten due to a duplicate name when the library is loaded.
             SDK.SAMPLES = {
                 _getServerUrl: function () {
                     ///<summary>
                     /// Returns the URL for the SOAP endpoint using the context information available in the form
                     /// or HTML Web resource.
                     ///</summary>
                     var ServicePath = "/XRMServices/2011/Organization.svc/web";
                     var serverUrl = "";
                     if (typeof GetGlobalContext == "function") {
                         var context = GetGlobalContext();
                         serverUrl = context.getServerUrl();
                     }
                     else {
                         if (typeof Xrm.Page.context == "object") {
                               serverUrl = Xrm.Page.context.getServerUrl();
                         }
                         else
                         { throw new Error("Unable to access the server URL"); }
                         }
                        if (serverUrl.match(/\/$/)) {
                             serverUrl = serverUrl.substring(0, serverUrl.length - 1);
                         } 
                         return serverUrl + ServicePath;
                     }, 
                 GetUserLastLoggedInRequest: function () {
                     var requestMain = ""
                     requestMain += "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">";
                     requestMain += "  <s:Body>";
                     requestMain += "    <Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">";
                     requestMain += "      <request i:type=\"a:RetrieveMultipleRequest\" xmlns:a=\"http://schemas.microsoft.com/xrm/2011/Contracts\">";
                     requestMain += "        <a:Parameters xmlns:b=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\">";
                     requestMain += "          <a:KeyValuePairOfstringanyType>";
                     requestMain += "            <b:key>Query</b:key>";
                     requestMain += "            <b:value i:type=\"a:QueryExpression\">";
                     requestMain += "              <a:ColumnSet>";
                     requestMain += "                <a:AllColumns>true</a:AllColumns>";
                     requestMain += "                <a:Columns xmlns:c=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" />";
                     requestMain += "              </a:ColumnSet>";
                     requestMain += "              <a:Criteria>";
                     requestMain += "                <a:Conditions>";
                     requestMain += "                  <a:ConditionExpression>";
                     requestMain += "                    <a:AttributeName>operation</a:AttributeName>";
                     requestMain += "                    <a:Operator>Equal</a:Operator>";
                     requestMain += "                    <a:Values xmlns:c=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\">";
                     requestMain += "                      <c:anyType i:type=\"d:int\" xmlns:d=\"http://www.w3.org/2001/XMLSchema\">4</c:anyType>";
                     requestMain += "                    </a:Values>";
                     requestMain += "                  </a:ConditionExpression>";
                     requestMain += "                  <a:ConditionExpression>";
                     requestMain += "                    <a:AttributeName>objectid</a:AttributeName>";
                     requestMain += "                    <a:Operator>Equal</a:Operator>";
                     requestMain += "                    <a:Values xmlns:c=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\">";
                     requestMain += "                      <c:anyType i:type=\"d:string\" xmlns:d=\"http://www.w3.org/2001/XMLSchema\">6e219f51-0310-4c4d-8c60-1c524e2ba7b3</c:anyType>";
                     requestMain += "                    </a:Values>";
                     requestMain += "                  </a:ConditionExpression>";
                     requestMain += "                </a:Conditions>";
                     requestMain += "                <a:FilterOperator>And</a:FilterOperator>";
                     requestMain += "                <a:Filters />";
                     requestMain += "              </a:Criteria>";
                     requestMain += "              <a:Distinct>false</a:Distinct>";
                     requestMain += "              <a:EntityName>audit</a:EntityName>";
                     requestMain += "              <a:LinkEntities />";
                     requestMain += "              <a:Orders>";
                     requestMain += "                <a:OrderExpression>";
                     requestMain += "                  <a:AttributeName>createdon</a:AttributeName>";
                     requestMain += "                  <a:OrderType>Descending</a:OrderType>";
                     requestMain += "                </a:OrderExpression>";
                     requestMain += "              </a:Orders>";
                     requestMain += "              <a:PageInfo>";
                     requestMain += "                <a:Count>0</a:Count>";
                     requestMain += "                <a:PageNumber>0</a:PageNumber>";
                     requestMain += "                <a:PagingCookie i:nil=\"true\" />";
                     requestMain += "                <a:ReturnTotalRecordCount>false</a:ReturnTotalRecordCount>";
                     requestMain += "              </a:PageInfo>";
                     requestMain += "              <a:NoLock>false</a:NoLock>";
                     requestMain += "            </b:value>";
                     requestMain += "          </a:KeyValuePairOfstringanyType>";
                     requestMain += "        </a:Parameters>";
                     requestMain += "        <a:RequestId i:nil=\"true\" />";
                     requestMain += "        <a:RequestName>RetrieveMultiple</a:RequestName>";
                     requestMain += "      </request>";
                     requestMain += "    </Execute>";
                     requestMain += "  </s:Body>";
                     requestMain += "</s:Envelope>";
                     var req = new XMLHttpRequest();
                     req.open("POST", SDK.SAMPLES._getServerUrl(), false)
                     req.setRequestHeader("Accept", "application/xml, text/xml, */*");
                     req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
                     req.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/xrm/2011/Contracts/Services/IOrganizationService/Execute");
                     req.send(requestMain);
                     //work with the response here
                     //var strResponse = req.responseXML.xml;
                     //alert(strResponse.toString());
                 },
       __namespace: true
      };
      
      

      Now you can call this jscript from a webresource by calling SDK.SAMPLES.GetUserLastLoggedIn()  All you should need to change (pass in) with this particular call would be the guid of the user you want to get the last access record for.

      - I hope this helps

      -

      Tuesday, August 7, 2012

      Stay on Top of Other Technologies - Great Rollup by UK PFE Team


      As an MVP, or a technologist in general, it is important to stay on top of other technologies other than just your break and butter.   The UK Premier Team put out this awesome rollup that is definitely worth a look if you are wondering what is going on in other areas of the Microsoft technology stack.

      The UK PFE team has a blog.  Check it out: http://blogs.technet.com/b/
      trm/


      en-gb/forefront/default.aspx

      en-gb/forefront/ee807302.aspx

      isablog/) is updated on a regular basis. Latest entries include:

      isablog/archive/2012/06/29/
      tmg-services-stopping-unexpectedly.aspx


      en-gb/forefront/edgesecurity/
      ee907407.aspx

      edgeaccessblog) is updated on a regular basis. Latest entries include:

      edgeaccessblog/archive/2012/
      06/28/when-configuring-the-array-manager-you-see-multiple-array-managers.aspx


      microsoft.com/wiki/contents/
      articles/tags/tmg/default.aspx.

      microsoft.com/wiki/contents/
      articles/tags/UAG/default.aspx


      microsoft.com/wiki/contents/
      articles/6458.microsoft-isatmguag-version-history-en-us.aspx

      microsoft.com/wiki/contents/
      articles/tags/UAG/default.aspx



      windows/b/bloggingwindows/
      archive/2012/07/18/windows-8-will-be-available-on.aspx



      forefront  


      fssnerds  



      virtualization  


      virtualworld  


      softgrid  






      askperf  


      networking  


      askcore  


      ntdebugging  




      us/download/details.aspx?id=
      30182

      us/download/details.aspx?id=
      29854

      us/download/details.aspx?id=
      29039

      us/download/details.aspx?id=
      7826

      us/download/details.aspx?id=
      30341

      us/download/details.aspx?id=
      30342

      us/download/details.aspx?id=
      30183

      us/download/details.aspx?id=
      30002


      events/default.mspx

      events/webcasts/calendar/
      monthview.aspx

      events/webcasts/library/
      default.mspx


      kb/2668751/en-US  

      kb/2704299/en-US  

      kb/2712561/en-US  

      kb/2715992/en-US  

      kb/2718841/en-US  

      kb/2719594/en-US  

      kb/2720599/en-US  

      kb/2722392/en-US  

      kb/2724184/en-US  

      kb/2725311/en-US  

      kb/2733143/en-US  

      kb/2718654/en-US  

      kb/2737485/en-US  

      kb/2704233/en-US  

      kb/2655992/en-US  

      kb/2691442/en-US  

      kb/2698365/en-US  

      kb/2718523/en-US  

      kb/2728973/en-US  

      kb/2721341/en-US  

      kb/944993/en-US  

      kb/2721254/en-US  

      kb/2721802/en-US  

      kb/2722138/en-US  

      kb/2733575/en-US  

      kb/976063/en-US  

      kb/2667462/en-US  

      kb/2668820/en-US  

      kb/2710487/en-US  

      kb/2718389/en-US  

      kb/2671814/en-US  

      kb/2705742/en-US  

      kb/2712286/en-US  

      kb/2718576/en-US  

      kb/2719347/en-US  

      kb/2720218/en-US  

      kb/2738482/en-US  

      kb/979394/en-US  

      kb/2559392/en-US  

      kb/2701373/en-US  

      kb/2708075/en-US  

      kb/2710870/en-US  

      kb/2714030/en-US  

      kb/2715078/en-US  

      kb/2715922/en-US  

      kb/2717045/en-US  

      kb/2719248/en-US  

      kb/2719704/en-US  

      kb/2720345/en-US  

      kb/2720568/en-US  

      kb/2667873/en-US  

      kb/2692409/en-US  

      kb/2739081/en-US  

      kb/976329/en-US  

      kb/2734222/en-US







      stefan_gossner/archive/2012/
      07/03/june-2012-cu-for-sharepoint-2010-has-been-released.aspx

      stefan_gossner/archive/2012/
      07/17/office-and-sharepoint-server-2013-preview-has-arrived.aspx

      stefan_gossner/archive/2012/
      07/19/developer-trainings-for-office-2013-and-sharepoint-2013.aspx

      com/blog/Pages/default.aspx

      Shows/This+Week+On+Channel+9/
      TWC9-July-20-2012


      mspremuk/  

      ragnarh/archive/2012/07/16/
      sharepoint-2013-links-downloads-and-resources.aspx

      en-US/evalcenter/hh973397






      kb/2596911
      kb/2596942
                                    
                     kb/2728313

      kb/2598348
                                   
      kb/2732019

      kb/2553365
                                    
                                    kb/2716884           

      kb/2695502
                                    
                                    kb/2598239
                                    
                                    kb/2553424
                                    
                                    kb/2553194

      kb/2672574








      dataplatforminsider/archive/
      2012/07/26/sql-server-2008-r2-sp2-now-available.aspx

      dataplatforminsider/archive/
      2012/07/24/check-out-the-latest-from-the-be-the-next-microsoft-employee-contest.aspx

      dataplatforminsider/archive/
      2012/07/12/microsoft-worldwide-partner-conference-2012-sql-server-partner-of-the-year-awards.aspx

      dataplatforminsider/archive/
      2012/07/11/microsoft-and-dell-release-mid-market-data-warehouse-appliance.aspx

      dataplatforminsider/archive/
      2012/06/14/hy-vee-boosts-performance-by-up-to-100x-increases-competitiveness-with-parallel-data-warehouse-deployment.aspx

      dataplatforminsider/archive/
      2012/06/13/new-sql-services-in-windows-azure.aspx



      stratany2012



      download/0/8/6/086EF32A-9A74-
      4978-AA76-89113AE58493/Fantastic-12-of-2012-Booklet-FINAL.pdf





      kb/2724881

      kb/2711671

      kb/2723814


      kb/2713151

      kb/2644794

      kb/2720940

      kb/2729953

      kb/2706551

      kb/2733630

      kb/2715951

      kb/2406666

      kb/2715953

      kb/2727322



      kb/970896

      kb/959420

      kb/954607

      kb/948108

      kb/231347








      mspremuk/  


      forefront  


      fssnerds  


      exchange/

      msukucc  

      msonline/  

      exchange/archive/2012/07/02/
      establishing-exchange-content-index-rebuild-baselines-part-3.aspx

      exchange/archive/2012/07/03/
      remote-connectivity-analyzer-gets-an-updated-captcha-experience.aspx

      exchange/archive/2012/07/06/
      crazy-about-dogfood-and-dogfooding-hybrid.aspx

      exchange/archive/2012/07/09/
      everything-you-need-to-know-about-exchange-backups-part-3.aspx

      exchange/archive/2012/07/13/
      announcing-a-licensing-change-for-multi-mailbox-search.aspx

      exchange/archive/2012/07/23/
      the-new-exchange.aspx

      exchange/archive/2012/07/25/
      microsoft-security-advisory-2737111-and-microsoft-exchange.aspx

      exchange/archive/2012/07/27/
      update-on-multi-mailbox-search-licensing.aspx

      msukucc/archive/2012/07/23/
      dirsync-database-keeps-on-increasing.aspx


      nexthop/  

      drrez/

      nexthop/archive/2012/06/29/
      teched-europe-2012-lync-sessions.aspx

      nexthop/archive/2012/07/03/
      lync-firewall-rules-viewer.aspx

      nexthop/archive/2012/07/06/
      how-to-troubleshoot-sign-in-issues-in-lync-online.aspx

      nexthop/archive/2012/07/10/
      lync-online-presentation-tips-and-tricks.aspx

      nexthop/archive/2012/07/17/
      get-the-new-office-preview.aspx

      nexthop/archive/2012/07/23/
      integrating-exchange-2013-preview-and-lync-server-2013-preview.aspx

      nexthop/archive/2012/07/24/
      lync-online-previews-get-the-latest-information-from-the-office-365-wiki-portals.aspx

      nexthop/archive/2012/07/26/
      update-client-virtualization-in-microsoft-lync-2010-white-paper.aspx

      nexthop/archive/2012/07/30/
      updates-to-the-lync-server-2010-multitenant-pack-for-partner-hosting-deployment-guide.aspx


      default.aspx  



      themasterblog  


      downloads/en/details.aspx?
      familyid=9587db25-13c4-4e90-9d1d-98cb366ec2d4  

      downloads/en/details.aspx?
      familyid=6fa94dc9-d4b6-402b-8c22-8a52acea2284  

      downloads/en/details.aspx?
      familyid=a9aae935-ad23-4117-a3d9-9ed6093d6d7f  

      downloads/en/details.aspx?
      familyid=ad3921fb-8224-4681-9064-075fdf042b0c  

      us/download/details.aspx?id=
      30391

      us/download/details.aspx?id=
      30337

      us/download/details.aspx?id=
      30338


      downloads/en/details.aspx?
      familyid=5e94ad07-902c-422f-aadd-ff2bba9e540a  

      downloads/en/details.aspx?
      familyid=e7a23d42-0835-440f-9400-badfe9672b21  

      downloads/en/details.aspx?
      familyid=e7a23d42-0835-440f-9400-badfe9672b21  



      downloads/en/details.aspx?
      familyid=ff200152-cdb0-4e88-b5ae-1b3dfccf1bf5  



      us/download/details.aspx?id=
      30349

      us/download/details.aspx?id=
      30350

      us/download/details.aspx?id=
      30351

      exe which is the redistributable you ship with your applications.
      us/download/details.aspx?id=
      30352

      us/download/details.aspx?id=
      30330


      downloads/en/details.aspx?
      familyid=7938423f-f99e-4130-8d79-000268af72dc  

      downloads/en/details.aspx?
      familyid=406fc4ba-cdd4-4dfc-a9da-3a31e9db218d  

      us/download/details.aspx?id=
      28786

      us/download/details.aspx?id=
      24677

      us/download/details.aspx?id=
      21305



      kb/920304/en-US  

      kb/257265/en-US  

      kb/2721098/en-US  

      kb/817903/en-US  

      kb/867504/en-US  

      kb/931742/en-US  

      kb/2701522/en-US  

      kb/2604978/en-US  

      kb/2725008/en-US  

      kb/2733921/en-US  

      kb/938781/en-US  

      kb/944641/en-US  

      kb/2167170/en-US  

      kb/2734219/en-US  

      kb/829197/en-US  

      kb/839647/en-US  

      kb/883915/en-US  

      kb/883942/en-US  

      kb/885227/en-US  

      kb/885243/en-US  

      kb/885244/en-US  

      kb/885872/en-US  

      kb/886803/en-US  

      kb/886804/en-US  

      kb/887568/en-US  

      kb/888616/en-US  

      kb/888991/en-US  

      kb/889097/en-US  

      kb/890050/en-US  

      kb/890342/en-US  

      kb/891007/en-US  

      kb/891115/en-US  

      kb/891196/en-US  

      kb/891519/en-US  

      kb/891576/en-US  

      kb/892057/en-US  

      kb/892299/en-US  

      kb/892404/en-US  

      kb/893050/en-US  

      kb/893052/en-US  

      kb/893305/en-US  

      kb/894317/en-US  

      kb/894539/en-US  

      kb/895318/en-US  

      kb/895679/en-US  

      kb/896253/en-US  

      kb/896261/en-US  

      kb/924423/en-US  

      kb/946208/en-US  

      kb/2596598/en-US  

      kb/2687310/en-US  

      kb/293650/en-US  

      kb/317819/en-US  

      kb/946983/en-US  

      kb/950794/en-US  

      kb/192478/en-US  

      kb/218381/en-US  

      kb/222237/en-US  

      kb/222303/en-US  

      kb/259957/en-US  

      kb/271786/en-US  

      kb/946986/en-US  

      kb/312985/en-US  

      kb/815354/en-US  

      kb/946985/en-US  

      kb/2679568/en-US  

      kb/2730669/en-US  

      kb/2732379/en-US







      mspremuk/  

      steverac/  

      rslaten/  

      manageabilityguys/  

      server-cloud/  

      andrew/  

      configurationmgr/  

      deploymentguys  

      mwiles/  

      carlossantiago/  

      mniehaus/  

      blogs/pthomsen/default.aspx  

      blogs/jgilbert/default.aspx  

      operationsmgr/  

      kevinholman/  

      jonathanalmquist/  

      jimmyharper/  

      emreguclu/  

      mpauthor/  

      orchestrator/  

      scvmm/  

      appv/  

      oob/  







      kb/2733915/en-US  

      kb/2724939/en-US  

      kb/823419/en-US  

      kb/885734/en-US  

      kb/906515/en-US  

      kb/2709521/en-US  

      kb/974144/en-US  

      kb/2719826/en-US