Friday, January 20, 2012

Custom Report for CRM 2011 Online tips and tricks

Hi, it's time to look at tips and tricks for custom Reporting Services report for CRM 2011 online!
- In this case we'll use FetchXML to connect to the CRM data! :)

Requirements:
  • Microsoft SQL Server 2008 or 2008 R2 Business Intelligence Development Studio (BIDS) installed
  • Microsoft Dynamics CRM 2011 BIDS Fetch Extension installed
  • Microsoft Dynamics CRM 2011 Online account
All this is allready installed in movie! So please install before watching movie if you're going to follow my movie to learn..

A nice blog about installing + basic setup: FetchXML - BIDS install - CRM 2011

Please note the following limitations:
  • You cannot specify left outer joins – e.g. The following is not supported: “Select all Accounts who do not have a related Completed Appointment record”
  • You cannot specify group by / sum queries – e.g. The following is not supported: “Select Account Name, count(*), sum(est. value) from Account Group By Account Name” – You can only select the records in detail and then perform the aggregation in your report. But…
  • Fetch XML queries return a maximum of 5000 records.
In these movies you'll see the following:

Part 1:
- Explaining how to setup the authentification to server
- Explaining hoe to get the fetchXML from CRM that you need.
- Showing the wizard and telling a bit tricks and tips
Part 2:
- Explaining Datasets and data sources
- Showing how to create parameters
- Basic GUI for reports
Part 1: 

Part 2:

 
Hope you found this usefull! :)

Friday, January 13, 2012

Several Basic Javascripts part 2

Hi, more basic javascripts!! Yes, we love them and hate them! Please read Several Basic Javascripts Part 1 aswell!

Get value of lookup: Xrm.Page.getAttribute("prefix_fieldname").getValue()[0].name
- read method as: get array 0's name (or Id)

Set Value of lookup:
var idValue = "2B0CDF21-7C04-E011-8ABA-00155D011B05"; //GUID of record
var textValue = "Prisliste"; //Name of record
var typeValue = "Pricelevel"; //Schema name of record entity
Xrm.Page.getAttribute("prefix_fieldname").setValue([{id: idValue, name: textValue, entityType: typeValue}]);

Show/hide section: Xrm.Page.ui.tabs.get(1).sections.get("Section_name").setVisible(false)
Set visible values: true or false
Tab value: number (1) or "name"
Section value: "name_of_section"

Show/hide field: Xrm.Page.getControl("prefix_fieldname").setVisible(false)
Set values: true or false

Show/hide tab: Xrm.Page.ui.tabs.get(5).setVisible(false);
Set Values: true or false

Save: Xrm.Page.data.entity.save();
Optional params: "saveandclose" or "saveandnew"

Set Require lvl: Xrm.Page.getAttribute("prefix_fieldname").setRequiredLevel('required');

Get length of string:
var oField = Xrm.Page.getAttribute("prefix_fieldname").getValue();
alert(oField.length);

Substract content of string:
var oField = Xrm.Page.getAttribute("prefix_fieldname").getValue();
alert(oField.substr(0,7);

Ex: "Consultancy" --> after substract: "Consult"

Set Focus:
Xrm.Page.getControl("prefix_fieldname").setFocus(true);

Hope you found this usefull! :)