Tuesday 16 July 2013

Retrieving Subgrid Items count using Javascipt in MS CRM 2011/MS CRM 2013

Retrieving Subgrid Items count using Javascipt.

1.Get the subgrid  using "Name" of subgrid as given below.
















2.Write the Javascript function as given below:

function subgridItemCount() {
 
      // Get the Subgrid Control
    var grid = Xrm.Page.ui.controls.get('LineItems')._control;
    if (grid.get_innerControl() == null) {
        setTimeout(subgridItemCount, 1000);
        return false;
    }
    else if (grid.get_innerControl()._element.innerText.search("Loading") != -1) {
        setTimeout(subgridItemCount, 1000);
        return false;
    }
    var countRec = grid.get_innerControl().get_allRecordIds().length;
    if (countRec > 0) {
        alert(countRec);
 
    }
 
}


For MS CRM 2013:

function FindControl() {
    if (document.getElementById('subgridName')!= null) {
        var count=document.getElementById('subgridName').control.get_totalRecordCount();
        alert(count);
        }
        else {
            setTimeout("FindControl()", 1000);
        }
    }


3.Result




























Hope this helps,

Regards,

Yusuf

Tuesday 2 July 2013

Retrieve N:N records in MS CRM 2011

Retrieving N:N records in MS CRM 2011 using LINQ requires less code and is straightforward.

I am assuming that "Account" is in N:N relationship with "Custom Entity".

Below is the screenshot for relationship





















Here is the Screenshot of account having custom entity records





























Query:

LINQ query to get all the N:N custom entity records for the above Account.

 string accountId = "CC572EC9-01E3-E211-AC62-984BE173A384";
  var customEntities = (from NtoN in makeUseOfContext.new_customentity_accountSet
                        where NtoN.accountid.Value == new Guid(accountId) && 
                        NtoN.new_customentityid != null
                         select new { 
                                    customentityid = NtoN.new_customentityid.Value 
                                   }).ToList();
        
Debug Mode:

















Similarly we can get the Accounts associated to the custom  entity.
Hope it will help someone somewhere :)

Thanks,
Yusuf

Microsoft Dynamics CRM - Orion release

The next major release of Microsoft Dynamics CRM will come in the form of the Orion release in the second half of 2013.

Major Changes:
.
The major themes for the Orion release are as follows:
• User Experience – Continuation of the journey in Polaris
• Ubiquitous – Role-tailored applications for Sales Professionals. (Ubiquitous key word replaces the word Mobile. You will be hearing this a lot more).
• Productivity – Internal Collaboration for the on-premise customers & Server Sync enhancements
• Business Process – Process-centric theme continued to the next level
• Online – Online first focus to continue (this means CRM Online will get all the new features first before OnPremise)

Orion User Interface:

Firstly, you will notice it has no ribbon. Next it has no left navigation bar. The navigation bar is now at the top (as shown in purple colour in the screenshot below).



Here is the full post.Refer this too.



Regards,

Yusuf