{New and improved Utility announcement}Security Role browser for Dynamics CRM 2015/2015 Update 1

The clock is ticking. I did the first version for 2011 and it continued on for CRM 2013 as well:

https://securityrolebrowserforcrm.codeplex.com/

It was one of the most liked utilities I developed and 2000+ downloads means it is useful!

There were some cool feature requests and other bug fixes.

Here is a sneak peak of what Latest version will bring:

· Support for 2015 and 2015 update 1

· New skin!

clip_image002

· Addition of Business units for filtering:

clip_image003

· Addition of Business unit on exported Grid:

clip_image005

· Addition of Miscellaneous privileges:

clip_image007

Some other new features will release with the main tool soon Smile Stay tuned

So, why the wait? Because all good things take time to build and the build is going through Pre-Live test.

Hope it helps and Happy CRMing!

{QUICK TIP} IMPORTANCE OF DAILY CRM STAND UP CALLS DURING DEVELOPMENT

The idea of Stand up meeting is very simple but meetings are always disliked by developers.

Daily CRM stand up calls give a clear idea on the ground level delivery of a CRM project during most phases of the project.

This blog particularly is targeted for Development phase.

The whole team (usually no more than 10 people) does something similar to a stand up so everyone can see each other.

In a Lync/Skype call it is moderated one by one in a given order.

The “facilitator” that was chosen for the team will go one by one and ask each team member three simple questions:

clip_image001

What did you do yesterday?

This can be things that were completed by a developer and helps to keep track

of the progress made on Development items.

clip_image002

What are you going to do today?

This can be things that are planned by a developer and helps the team to know

the work which will be done today by each developer.

clip_image003

Is there anything stopping you from getting your work done?

This are blockers that will stop the developer for getting his or her job done on time and must be resolved.

Usually it is the responsibility of Team lead/Project manager to get a quick resolution for this problems/issues.

clip_image004

Don’t!

· Make it a technical discussion

· Make it a forum for personal issues

· Make it an advisory board.

It will prove effective strategy as long as above 3 points are not made part of this meeting!

Hope it helps and Happy CRMing!

{Customization and Scripting Tip} Workaround for showing some number fields without comma in Dynamics CRM

Dynamics CRM provides a wide range of fields, one of them is whole number fields.

Sometimes there is a requirement to show this whole number fields in Dynamics CRM without the “,” in the value.

This can be easily achieved if we want to remove “,” from all whole number fields by

navigating to Personal settings and remove it for all whole number fields.

However, it is not often the case when I would want to remove comma from all my whole number fields.

So, the workaround?

I went through a few options and choice is totally dependent on the business scenario at hand.

I am taking example of a Year field below:

If you have a pre-set field for year you can go for a lookup field or option set if the number of years

in the field is lesser.

In my case I have done a small text field of length 4 and added some scripting to the same

End result is something like this:

If I enter a non-numeric field in the Text year field and hit save:

clip_image001

When numeric value is entered, lets the user save:

clip_image002

Volla, without a comma, which was indeed the base of the problem.

And the script behind (You can definitely add a year range validation also, I skipped it in

This example):

function onsave(context)

{

 var stringValue = Xrm.Page.getAttribute(“dynamics_year”).getValue();

 var numberValue = parseInt(stringValue);

    if(isNaN(numberValue)) {

    Xrm.Page.ui.setFormNotification(“Year is not entered in correct format.”, “ERROR”,“1”);

    // Do not let user save

    context.getEventArgs().preventDefault();

    } 

    else

    {

     Xrm.Page.ui.clearFormNotification(‘1’);

    }

}

 

One last thing, to note: During registering the script on save event on the form do not forget

the highlighted checkbox (to pass the context to the script as first parameter):

clip_image001[4]

Hope it helps and Happy CRMing!

{New Utility} Synchronous Rollup for Dynamics CRM 2015

Synchronous Rollup is a utility to apply rollup synchronously as well as has some advantages over the

limitations provided by Rollup fields for specific business scenarios.

How to Apply Sync Rollup?

The solution comes with a Parent and Child entity, a sample workflow and a custom workflow activity.

The allowed values for operation name are:

· sum

· avg

· min

· max

The allowed value for output type are:

· money

· decimal

· int

Conditions can be set in the workflow when to use them.

Series of workflows can be used in Tandem.

Advantages:

· You can define a maximum of 100 rollup fields for the organization and up to 10 rollup fields per entity.

No such restrictions, only performance considerations while using this utility.

· A workflow can’t be triggered by the rollup field updates, no such restrictions using this utility.

· A rollup over the rollup field is not supported, but in this utility is supported.

· The business rules, workflows or calculated fields always use the last calculated value of the rollup field.

Using this utility they give the latest value.

Where to Download? Here: Click here

Sample Configuration:

clip_image001

clip_image003

clip_image004

How it is done?

Aggregate Fetchxml queries

Note: Only works for 1:n relationship types.

Please let me know if there are any issues in comments.

Hope it helps and Happy CRMing!

{SCIRPTING TIP} Filter Lookup field based on Date Range in Dynamics CRM

Requirement: to filter a Lookup field options dependent on the date field in the current entity.

clip_image001

Description: The lookup field has fields for dates and field should be filtered based on them. For example,

Date on the current entity is 07/10/2015. Lookup field start date should only allow start date in lookup entity to be earlier or equal to 07/10/2015 and end date on the lookup field should be same or after the current entity date 07/10/2015. Only those dates should be allowed to selection.

Code:

This was achieved by adding Pre-filter to the lookup field as below:

function preFilterLookup()

{

      Xrm.Page.getControl(“lookupfieldname”).addPreSearch(function ()

      {

            var dateObject = Xrm.Page.getAttribute(“datefieldname”).getValue();

            var editedDate = yyyymmdd(dateObject);

           

            if (dateObject != null)

            {

                  // Filter the fetchxml by date range

                  fetchXml = “<filter type=’and’><condition attribute=’startdatefieldname’ operator=’on-or-before’ value='” + editedDate +

                        “‘ /><condition attribute=’enddatefieldname’ operator=’on-or-after’ value='” + editedDate +

                        “‘ /></filter>”;

                  // Apply the filter to the field

                  Xrm.Page.getControl(“lookupfieldname”).addCustomFilter(fetchXml);

            }

      });

}

Hope it helps and Happy CRMing!

{CODE TIP}Aggregate Fetchxml queries code for Dynamics CRM

I had written a post long back showcasing the aggregate queries on Dynamics CRM on the below link:

https://dynamicsofdynamicscrm.wordpress.com/2014/07/23/aggregate-fetchxml-queries-for-dynamics-crm-20112013/

This is a very performance effective and seldom used piece from most CRM girls and guys out there.

I had got lot of feedback and comments but somehow people were not able to use it in actual code.

So, I had committed to doing a follow-up article with actual reusable code asset. It took a while for

me to come back to this one, but I never break my promises.

clip_image001[4]

So here it goes(The aliased value is Money in my example, it can be decimal and integer as well): 

    public static decimal GetSum(string primaryEntityId, IOrganizationService service)

        {

            string fetchXml = @”<fetch mapping=’logical’ aggregate=’true’ version=’1.0′>” +

                                        “<entity name=’childentityname’>” +

                                         “<attribute name = ‘attributetoadd’ alias=’sum_attributetoadd’ aggregate=’sum’ />” +

                                            “<filter>” +

                                             “<condition attribute = ‘primaryEntityIdfieldname’ operator=’eq’ value='” +

                                                primaryEntityId

                                                + “‘ />” +

                                                “</filter></entity></fetch>”;

            FetchExpression fetch = new FetchExpression(fetchXml);

            EntityCollection result = service.RetrieveMultiple(fetch);

            decimal sum = 0;

            if (result.Entities.Count == 1)

            {

                sum = ((Money)((AliasedValue)(result.Entities[0].Attributes[“sum_attributetosum”])).Value).Value;

            }

            return sum;

        }

 

Hope it helps you and Happy CRMing!