Archive

Posts Tagged ‘CRM 2013’

Passing data between web resources CRM 2013

October 21, 2014 Leave a comment

Assume you have 2 HTML web resources on your CRM form and you want to pass data from 1 resource to another, below are the steps. In my example I have 2 HTML pages with a Textbox and Button.  

Form with 2 Webresources

Form with 2 Webresources

On Button click, I am reading the value from current HTML page Textbox and setting in to other HTML resource. Below is the script on button click event.

               // Get the other web resource using ‘Parent.Xrm’ var otherResource = parent.Xrm.Page.ui.controls.get(‘{Webresource_SchemaName}‘).getObject().contentWindow; // Get the Text box control from other resource var txtBoxOtherResource = otherResource.document.getElementById(“txtPage2”).value; // Set the value to the Text box control txtBoxOtherResource.value = document.getElementById(‘txtPage1’).value;

Note : To get schema name of a webresource,

  • Open the Customizations form
  • Double click on the web resource and get it as mentioned below
Webresource Schema Name

Webresource Schema Name

🙂

Categories: CRM Tags: , ,

Execute Custom Action using Late Binding – CRM 2013

Custom Actions provide the ability to write reusable modules of logic that can be triggered through client-side or server-side code.

Custom actions run synchronously and can take in parameters as well as return values.

In this article I will walk you through creation of a Custom Action with Input Parameters and execute the same using SDK call.

My Custom Action created on ‘Account’ entity and will do below actions

  • Takes a Input Parameter of type ‘Entity Reference’ to User, to set Owner of the Task to Accounts Owner
  • Create a new Task
Custom Action

Custom Action

  • Sets Owner of Task to Account’s Owner
Custom Action - Create Task

Custom Action – Create Task

  • Make sure you publish the ‘Custom Action’

Execute Custom Action :

  • We can execute Custom Action using Early or Late binding approach
  • For early binding we need to generate wrapper using exe tool by including ‘generateActions’ tag in console command.

CrmSvcUtil.exe /url:http://<serverName>/<organizationName>/XRMServices/2011/Organization.svc /out:<outputFilename>.cs /username:<username> /password:<password> /domain:<domainName> /namespace:<outputNamespace> /serviceContextName:<serviceContextName> /generateActions

  • Below is the code to execute using Late Bound technique

OrganizationRequest executeCreateTaskOnAccount = new OrganizationRequest(“new_CreateTaskOnAccount”);
// Set Account Owner EntityReference Input Parameter
Guid accountOwnerId={Account Owner GUID};
var accountOwner = new EntityReference(“systemuser”, accountOwnerId);
executeCreateTaskOnAccount.Parameters.Add(new KeyValuePair<string, object>(“AccountOwner”, accountOwner));
organizationService.Execute(executeCreateTaskOnAccount);

Few points :

  • Custom actions can be triggered using JScript and SDK calls
  • We cannot execute Custom Actions from a workflow
  • However you can create a Custom Workflow with ‘Custom Action’ execution logic and call from a Workflow
  • A security privilege named Activate Real-time Processes (prvActivateSynchronousWorkflow) is required to activate an action’s real-time workflow so that it can be executed

🙂

Categories: CRM 2013 Tags: , ,

Teams vs Access Teams vs Access Team Templates – CRM 2013

August 24, 2014 1 comment

As we know “Access Teams” are one of the new feature in CRM 2013.

Let’s see how this is different from Legacy Owner Team and finally how is it different from “Access Team Templates”.

Consider a scenario, Where we need to change the Accessibility of ‘Account’ records frequently

  • I have 3 Accounts in my system
  • Account 1 can be (Read/Write/Delete) only by User 1,User 2, User 3
  • Account 2 can be (Read/Write/Delete) only by User 4,User 5, User 6
  • Account 3 can be (Read/Write/Delete) only by User 6,User 7, User 8

We can achieve above requirement by below approaches.

Approach 1:

  • Create 3 teams with a Security role having Read, Write, Delete Privileges to Account
    • Team 1 (User 1,2,3), Team 2 (User 4,5,6), Team 3 (User 6,7,8)
  • Change the Ownership of Accounts to
    • Owner of Account 1 = Team 1; Account 2=Team 2 and Account 3 =Team 3
  • Or Share the Account records to Teams instead of Ownership.

Drawbacks of Approach 1 :

  • Sharing records to a Team with the same sets of users, with the same rights is a performance over head.
  • Add/remove users from team require CRM to reset the Cache and must be recreated by querying the SQL next time the user tries to perform any action.
  • We cannot show who all are working on the Account on the form (Only was is to open Share window and go to the Team to see the list of Users).

Approach 2:

  • Using Access Teams; Let’s see how it is different from old Team approach.

Access Teams :

  • In simple terms, Access Team is a kind of Team with no security role (i.e., No specific privileges at that time of Team creation)
  • Privileges are determined when you align the Access Team to a record via Sharing.
Share Access Team

Share Access Team

Access Team Templates :

  • We define a set of privileges while creating ‘Team Template’
Access Team Template

Access Team Template

  • Add a “Access Team” sub grid on the form. (How to create and add as Sub grid)
  • Add different Users to the “Access Team Sub Grid” for different Accounts. (i.e., User 1,2,3 for Account 1;User 4,5,6 for Account 2…).
Access Team Sub Grid On Account Form

Access Team Sub Grid On Account Form

Access Team vs Access Team Templates :

  • Underlying principle for both Access Team and Access Team Templates are same that No associate security role.
  • With ‘Access Team Templates’ privileges are pre-determined, but the people are not. With Access Teams, the people are pre-determined, but the privileges are not.

Team vs Access Teams :

  • Teams associated with a Security Role but not the case with Access Teams.
  • Records cannot be owned by Access Teams.
Access Teams Are Not For Ownersip

Access Teams Are Not For Ownership

  • You can create views or reports on Access Team Members but not with Teams.

Few more points :

  • Users have to have to Share privilege to add Users to “Access Team” sub grid.
  • We can have more than 1 Access Team sub grid on a form
  • The default number of access teams templates for each entity is two
  • The number of access team templates you can have for each entity is controlled by the MaxAutoCreatedAccessTeamsPerEntity deployment setting.
  • MaxEntitiesEnabledForAutoCreatedAccessTeams deployment setting has a default value of 5. This controls the number of entities it’s possible to enable for auto-created access teams.
  • We can change the MaxEntitiesEnabledForAutoCreatedAccessTeams , MaxAutoCreatedAccessTeamsPerEntity only on Premise installations and cannot edit them for Online.
  • To delete a Access Team Template, we need to remove all the associated ‘Access Team Template’ sub grids before.
  • A system generated Access Team isn’t created for each record until you add a user to the sub grid on the entity.
  • We can covert normal Teams to Access Teams.

🙂

Target CRM Version in Solutions – CRM 2013 Spring feature

With Spring update we got a new option “Target CRM Version” while exporting the solution.

Available options are 6.1 (default) and 6.0.

Target Solution CRM Version

Target Solution CRM Version

If you choose 6.0, any new capabilities of version 6.1 will not be included in the exported solution and any organizations still using version 6.0 will be able to install the solution.

All the removed or modified components will be listed out in a dialog.

Removed or Modified components

Removed or Modified components

Note – “Target CRM Version” option is unavailable if you export Default solution.

IntroducedVersion Property

  • In CRM 2013, solution component has an IntroducedVersion property.
  • This value captures the current product version number of the solution that the solution component was associated with when it was created.

Refer these links for more info

🙂

Categories: CRM 2013 Tags: ,

CRM Developer Toolkit for Visual Studio 2013

There is no release of CRM Developer Toolkit for VS 2013.

However by hacking the CRM Developer toolkit for VS 2012 we can get Developer Toolkit work for VS 2013.

Refer steps mentioned in this article.

🙂

Loading dependent jscript libraries in ribbon button’s execution CRM 2013

In CRM 2011, To load the dependent Jscripts on execution of ribbon button command actions

  • We can add the dependent script as a Library in the “Javascript Command” and pass “isNaN” as Function Name (Refer my existing article)

In CRM 2013, I observed a slight change in the execution w.r.t the order.

The dependent script files has to be ordered before the actual script file.

Dependent script file is not loading if the order of the file next to the actual script file.

Dependent JScripts Order

Dependent JScripts Order

In the above scenario there are 2 “Javascript Command” pointing to different web resources.

The “Javascript Command:isNaN” is my dependent script file hence I put that as 1st command.

Quick Create Forms – CRM 2013

‘Quick Create’ form is the latest addition in CRM 2013 new set of features.

‘Quick Create’ form enable you to create records quickly by just filling the key information (i.e., fields) using global ‘Create’ button.

Global Create Button

Global Create Button

In this article I would like to provide few key points about ‘Quick Create’ form

  • To enable ‘Quick create form’ for an entity, you have to check “Allow quick create” check box under Data Services in entity properties.
Allow Quick Create

Allow Quick Create

  • To create a new ‘Quick create form’, go to Entity -> Forms -> New -> Quick Create Form
Quick Create Form

Quick Create Form

  • Quick form only contain one Tab and three Section , we can’t add new tab or section.
Quick Create Form Design

Quick Create Form Design

  • Publish the Customizations.
  • Click on global ‘Create’ button on Navigation bar and select the entity and you get the form
Quick Create Form

Quick Create Form

‘Business Rules’ on Quick Create forms

  • ‘Business Rules’ work on ‘Quick Create Forms’
  • To enable ‘Business Rule’ to work on ‘Quick Create Form’, we just need to set the scope of ‘Business Rule’ to ‘All Forms’.
Business Rules Scope

Business Rules Scope

I will keep adding few more points, if I come to know.

🙂