MS crm 2013/2015 connecting to Power BI

February 5, 2015 Leave a comment

Below are the steps to connect CRM ODATA to the Power BI in excel.

1. Make sure you have Power query add-on installed for your excel.

2.If you already have Power query installed you will see new tab in excel “Power Query”

2015-02-05_0745

3.To connect CRM in excel click on power query tab and in the other sources

2015-02-05_0747

4.CLick on other Odata Feed

5.Once you click on OData feed it will prompt to enter Odata feed URL .You can get CRM ODATA URL by going to

settings->Customization->Developer Resources ->Organization Data Service

2015-02-05_0800

6.copy the odata url and paste in the OData feed url sceen

2015-02-05_0747_001

7.Once you click on ok , it will pormpt to sign in. Clik on Organizational account

2015-02-05_0748

8.Enter the credential of CRM to login and save the connection .

2015-02-05_0749_001

9.Once you save the connection, it will load all the entities avilable in your crm and you can choose which entity record data you want to load into excel.Once data is loaded you can play around with BI query to make it better.

Advertisements
Categories: Uncategorized

Unlock fulfilled order by mistake for edit

January 27, 2015 Leave a comment

Lot of times i see in community forum people asking how to unlock order that is fulfilled by mistake. I come across same kind of requests from our order processing team in the past.

To unlock an order that is fullfilled by mistake follow below steps.

1.Create a ondemand workflow on order entity.

2. Add step -> Change status

3.By default it will show order entity in the drop down and in the status drop down choose any one of the item under Active -> New or pending .

4.Activate the workflow.

5.Open the order that you want to unclock and click on run workflow and choose the newly created workflow

6.Once workflow status change to success , refresh the order record and you will see order is unlocked for edit now.

2015-01-27_1158

Categories: Uncategorized

Set User Default view using REST API

December 30, 2014 Leave a comment

I had a requirement to update users default view based on their role  programmatically in Bulk  and thought sharing this info that may be helpful for someone

Below script will update users Account entity default view to “Active Accounts”

You need to pass  Entity Typecode,ViewID, Language Code

var entity = {};
entity.PersonalizationSettings = “<DefaultGridViews> <DefaultGridView> <EntityTypeCode>1</EntityTypeCode> <ChildEntityName></ChildEntityName> <QueueId></QueueId> <ViewId>{00000000-0000-0000-00AA-000010001002}</ViewId> <ViewType>1039</ViewType> </DefaultGridView> </DefaultGridViews>”;

var req = new XMLHttpRequest();
req.open(“POST”, encodeURI(Xrm.Page.context.getClientUrl() + “/XRMServices/2011/OrganizationData.svc/UserSettingsSet(guid’3472C864-F9EC-4FB4-8C35-CFD630ED0696‘)”), true);
req.setRequestHeader(“Accept”, “application/json”);
req.setRequestHeader(“Content-Type”, “application/json; charset=utf-8”);
req.setRequestHeader(“X-HTTP-Method”, “MERGE”);
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 204 || this.status == 1223) {
alert(“Updated”); //Success – No Return Data – Do Something
}
else {
alert(this.statusText);
}
}
};
req.send(JSON.stringify(entity));

Tip : MS CRM 2015 Enable Web resource and Iframe support in Tablet

December 1, 2014 1 comment

MS CRM 2015 looks like going to support  web resources and Iframe in  tablet. Here is the settings where you can configure this.

Go to Settings->Administration->System Settings-> Customization Tab check the “Enable Web resources and Iframes for tablet”

It does says its preview feature only so if you come across any issue, Microsoft may not support.

2014-12-01_1136

 

Categories: MS CRM 2015

Tip : Save Read-only field values when value set by Business Rule

November 4, 2014 Leave a comment

We all know when field is set to read-only  on the form it won’t be saved until we set SumbitMode = “always” . For example if you populate value of the field2 ( Read-only)  based on  field1 on the form  using Business rule  when you save the record,  field2 value won’t be saved as it’s a read-only field on the form.

To fix this issue  add field2 to the form one more time with “Show by dafault” unchecked and as read-write.

Basically we have Field2 twice in the form , one field set to read-only ( Field Read-only checked) and “Visible by default” checked . Other one is read-write ( Field Read-only Unchecked)  and “Visible by default” unchecked ( not visible in the form). When we populate Field2 value using Business rule it sets the Value on both the instance of the field2. As one instance of the field is read-write,  system automatically saves the field value.

 

1. Field  “Test1”  added twice in the form, one is read-only and set “Visible by Default” checked  , other one set to Read-write and “Visible by default ” unchecked

2014-11-04_1848

2. Business Rule to Update Test1″ field value whenever email changes.

2014-11-04_1852

3.Form when you create new record or existing record

 

2014-11-04_1854

 

4. Field “Test1” value saved even though it set to read-only on the form.

 

2014-11-04_1856

Categories: Uncategorized

MS CRM 2011/2013 : Polymorphic Data Rollup Workflow Activity ( 1:N )

October 28, 2014 3 comments

Has we come across lot of times to rollup data from all child records to Parent record ( N:1) , created generic Data Rollup workflow activity to solve this problem.

Scott Polymorphic Input Parameter helped to achieve this.  

https://community.dynamics.com/crm/b/develop1/archive/2014/08/02/polymorphic-workflow-activity-input-arguments.aspx

 

The logic of this workflow is very simple.

It  takes following parameters as Input in the Workflow activity and rollup’s the data from child records to Parent record.

1. Dynamics Record URL ( Parent Record)

2. Logical Name of the Parent Entity

3.Lookup Attribute name of the Parent entity in child entity

4. Include only child records with set of statuses

5.Include only child records with set of Status reasons.

6. Parent and child Attribute names to rollup data  ex :  {ParentAttribute1 :  ChildAttribute1},{ParentAttribute2:ChildAttribute2}

Each pair represents the rollup filed in the parent record and child record. You can add as many rollup fields you want as long as Parent field name is unique. I mean parent attribute name should not duplicate.

You can use this workflow activity in Back-ground process as well on Real-time workflow to Rollup Sum into parent record immediately.

At present this workflow only supports Sum of fields and updating parent record with the same.

Supported data type for rollup attributes  are

1. Whole Number , Decimal , and Float

2. Currency.

You can find managed solution ,Dll and Source code in Codeplex

https://crm2013genericdatarollupworkflow.codeplex.com/releases

 

 

MS CRM 2013 Adding Custom RIbbon button in dashboard

October 21, 2014 2 comments

In my current project our client asked to add all Essential functionality within the dashboard. In order achive this created web resource with links to all essential functionality like running common Dialogues, Ruining common reports and more.   When i showed this to our client they were not happy with the links with in the dashboard. They want all of them opened from the Ribbon button rather as a links within the webresource. I know how to add custom button at entity,subgrid and home page but never tried to add Custom button within the dashboard Page.

After spending sometime with the Application Ribbons xml , i was able to add custom button on the Dashboard. Adding custom button on the dashboard is very similar to adding buttons on the entity form. Only difference is you need to know location group id of the dashboard.

To add custom button on the Dashboard

1. Create new Solution and add Application ribbon as component.

Click on Client Extensions -> Add Existing >> Application Ribbons

2.Export the solution and copy the Customization.xml file to add custom button.

3. Open the customization file and find the <RibbonDiffXml> and  add the customactions as below

<RibbonDiffXml>
<CustomActions>
<CustomAction Id=”Mscrm.DashboardTab.Actions.CustomAction” Location=”Mscrm.DashboardTab.Actions.Controls._children”>
<CommandUIDefinition>
<Button Id=”Mscrm.DashboardTab.Actions.CreateInvoice.Button”
Command=”omb.omb_invoice.CreateInvoice.Command”
Sequence=”45″
LabelText=”Create Invoice”
ToolTipTitle=”Create Invoice”
ToolTipDescription=”Create Invoice”
TemplateAlias=”o2″
Image16by16=”/_imgs/ribbon/New_16.png”/>
</CommandUIDefinition>
</CustomAction>

</CustomActions>

Add Command definition as you do in entity custom button.

<CommandDefinitions>
<CommandDefinition Id=”omb.omb_invoice.CreateInvoice.Command”>
<EnableRules />
<DisplayRules/>
<Actions>
<JavaScriptFunction FunctionName=”Develop1_RibbonCommands_runDialogGrid” Library=”$webresource:omb_rundialog”>
<StringParameter Value=”3BC99E21-EECB-E311-9517-6C3BE5A80184″ />
<StringParameter Value=”systemuser” />
<StringParameter Value=”FA2AB070-0FA3-4BD7-A8C2-22ECD9BC404C” />
</JavaScriptFunction>
</Actions>
</CommandDefinition>

</CommandDefinitions>

4.Save the customization and place saved customization file back to Solution Zip file

5. Import the solution and publish it .

Reload your dashboard to see the new button

2014-10-21_2156