الثلاثاء، 22 ديسمبر 2015

Google Chrome browser error:xmlhttprequest cannot load is not allowed by access-control-allow-origin

In that case you can change the security policy in your Google Chrome browser to allow Access-Control-Allow-Origin. This is very simple:
  1. Create a Chrome browser shortcut
  2. Right click short cut icon -> Properties -> Shortcut -> Target
Simple paste in "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-file-access-from-files --disable-web-security.


الأربعاء، 21 أكتوبر 2015

How To Get Base Currency in CRM 2011,2013,2015

QueryExpression query1 = new QueryExpression("transactioncurrency");
        query1.ColumnSet = new ColumnSet(new string[1] { "isocurrencycode" });
        QueryExpression query2 = query1;
        query2.AddLink("organization", "transactioncurrencyid", "basecurrencyid", JoinOperator.Inner);
        Entity entity = CrmServiceHelper.Service.RetrieveMultiple(query2).Entities[0];
        if (entity == null)
            return;
        string BaseCurrency = entity["isocurrencycode"].ToString().ToUpper();

الخميس، 20 أغسطس 2015

CRM Update Rollup 16:Action Microsoft.Crm.Setup.Common.Update.DBRemoveAction failed

When i try to uninstall the update rollup 16 i get the following error:

Action Microsoft.Crm.Setup.Common.Update.DBRemoveAction failed.

Exception has been thrown by the target of an invocation.

organization With Id = xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx Does Not Exist

Solution:
write the following query in SQL server for MSCRM_Config database:

Select FreindlyName from Organization
where Id='xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx'

then from the deployment manager disable and delete this organization.

الأحد، 26 يوليو 2015

Dynamics CRM 2013 :Read Sub-Grid Cell value

Here is sample code to get sub grid cell value in MS CRM 2013.

function GetSubGridCellValues() {
    if (document.getElementById("SubGridName")) {
        var grid = document.getElementById("SubGridName").control;
        var ids = gridControl.get_allRecordIds();
        for (i = 0; i < ids.length; i++) {
            alert(gridControl.getCellValue('fieldName', ids[i]));
        }
    }
    else {
        setTimeout("GetSubGridCellValues();", 1000);
    }
}