mercredi 6 août 2014

Error: Unable to log on to Microsoft Dynamics AX.


If you get the error message "Unable to log on to Microsoft Dynamics AX" when opening the AX client and you find nothing on the windows Events of the AOS, Client or SQL server.

This is a problem with stored passwords in the client machine.

Just navigate to the Control Panel - Stored passwords or Network passwords (Depending on OS), and delete any entries related to the AOS server.

Performance problem in CRM 2011 with the function fn_POARetrieveMultiple



After some month of usage, we find a performance problem in CRM and regularly with find the waring mesage in the windows events
Query execution time of 10.7 seconds exceeded the threshold of 10 seconds. .....
After investigation the problem is with the table valued function fn_POARetrieveMultiple.

ALTER function [dbo].[fn_POARetrieveMultiple](@userid as uniqueidentifier, @otc as int)
returns @poa table
(
 ObjectId uniqueidentifier primary key clustered
)
as
begin
 insert into @poa
 select distinct POA.ObjectId from PrincipalObjectAccess POA with (NOLOCK)
  join SystemUserPrincipals sup with (NOLOCK) on POA.PrincipalId = sup.PrincipalId
  where sup.SystemUserId = @userid
  and POA.ObjectTypeCode = @otc and
  ((POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1
 return
end



If we execute the query in the function, the query return result in 0 seconds.

select distinct POA.ObjectId from PrincipalObjectAccess POA with (NOLOCK)
  join SystemUserPrincipals sup with (NOLOCK) on POA.PrincipalId = sup.PrincipalId
  where sup.SystemUserId = 'd811762f-f682-e111-939f-0050568373d7'
  and POA.ObjectTypeCode = '4200' and
  ((POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1

 

But if we we call the function directly, the query return result in 10 seconds.

select ObjectId from fn_POARetrieveMultiple('d811762f-f682-e111-939f-0050568373d7', 4200)

After some search on Google I discovered that if we alter the function, the query (select ObjectId from fn_POARetrieveMultiple('d811762f-f682-e111-939f-0050568373d7', 4200) ) return result in 0 seconds.
But after some minutes, it take 10 seconds again.

I think that the problem is solved in this patch http://support.microsoft.com/kb/2566163/en-us, but it was not possible for us to update sql server quickly.
The workaround was to modify the function to force a recompilation for each call, I added the line
OPTION (RECOMPILE)

ALTER function [dbo].[fn_POARetrieveMultiple](@userid as uniqueidentifier, @otc as int)
returns @poa table
(
 ObjectId uniqueidentifier primary key clustered
)
as
begin
 insert into @poa
 select distinct POA.ObjectId from PrincipalObjectAccess POA with (NOLOCK)
  join SystemUserPrincipals sup with (NOLOCK) on POA.PrincipalId = sup.PrincipalId
  where sup.SystemUserId = @userid
  and POA.ObjectTypeCode = @otc and
  ((POA.AccessRightsMask|POA.InheritedAccessRightsMask) & 1) = 1
  OPTION (RECOMPILE)
 return
end

It's a temporary solution that worked for me, we will remove the line after the update of sql server.
!!unsupported fix

Links that can help you

http://030bacf.netsolhost.com/WordPress/?author=1&paged=2
http://sqlperformance.com/2013/08/t-sql-queries/parameter-sniffing-embedding-and-the-recompile-options
http://support.microsoft.com/kb/2566163/en-us
http://pratchev.blogspot.fr/2007/08/parameter-sniffing.html

jeudi 7 novembre 2013

Clearcase and Clearquest Web 8.0.1 with WebSphere 8.5.5


After the installation of Clearcase and Clearquest 8.0.1 with WebSphere 8.5.5, the port forward from the IBM Http Server to WebSphere has not bean created in my environement for an unknow reason.

http://localhost/cqweb !=> http://localhost:12080/cqweb

I followed the procedure below to solve my problem.




Stop Apache and WebSphere

/opt/IBM/HTTPServer/bin/apachectl stop
/opt/IBM/RationalSDLC/common/ccrcprofile/bin/stopServer.sh server1
/opt/IBM/RationalSDLC/common/cqwebprofile/bin/stopServer.sh server1
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/stopServer.sh server1



Open the file /opt/IBM/HTTPServer/conf/httpd.conf

Find the line to find the path of plugin-cfg.xml:

WebSpherePluginConfig /IBM/WebSphere/Plugins/config/webserver1/plugin-cfg.xml

Make an backup of plugin-cfg.xml

mv /IBM/WebSphere/Plugins/config/webserver1/plugin-cfg.xml /IBM/WebSphere/Plugins/config/webserver1/plugin-cfg.bak

Go to the binaries folder of WebSphere

cd /opt/IBM/WebSphere/AppServer/bin

./GenPluginCfg.sh -profileName cqwebprofile
./GenPluginCfg.sh -profileName ccrcprofile

 ./pluginCfgMerge.sh /IBM/RationalSDLC/clearquest/cqweb/cqwebprofile/config/cells/plugin-cfg.xml /IBM/RationalSDLC/common/ccrcprofile/config/cells/plugin-cfg.xml /IBM/WebSphere/Plugins/config/webserver1/plugin-cfg.xml





http://pic.dhe.ibm.com/infocenter/cqhelp/v8r0m0/index.jsp?topic=%2Fcom.ibm.rational.clearquest.install_upgrade.doc%2Ftopics%2Ft_install_was_ihs_redirect.htm

jeudi 27 juin 2013

Excel To Dynamics CRM 2011



I added in codeplex the tool  Excel to Dynamics CRM, it's a beta version.

Excel to Dynamics CRM for Microsoft Dynamics CRM 2011 makes it easier for the CRM users to upsert (update and/or insert) data from an Excel file.


The tool will analyse if the data in the Excel file are correct or not.
And if the data are correct, the tool will update the records in CRM if he can match the excel line with an existing record, or he will create a new line.

I recommend to use the existing import feature of Dynamics CRM 2011, but in some specific case, this tools can be help you.
You can find more infor and download this Tools at this address :


https://exceltodynamicscrm.codeplex.com/

 

lundi 17 juin 2013

CRM 2011 Outlook : Check who use the add-in

Hi,

if you need to check the list of users that use the CRM 2011 Outlook Client, you can check in the SubscriptionSyncInfo table on the base <org>_MSCRM.


select c.FullName, a.SubscriptionId, case when b.SubscriptionType = 0 then 'Offline'
when b.SubscriptionType = 1 then 'Outlook'
when b.SubscriptionType = 2 then 'AddressBookProvider'
end as 'Subscription_Type', COUNT (*) as NumOfSyncs,
MAX (a.StartTime) ,
MAX (a.EndTime)
from SubscriptionSyncInfo a
join Subscription b on a.SubscriptionId = b.SubscriptionId
join SystemUserBase c on b.SystemUserId = c.SystemUserId
group by c.FullName, a.SubscriptionId, b.SubscriptionType

mercredi 5 juin 2013

How to update the help link Url in CRM 2011

If you need to change the default Url of the help link in CRM 2011 .


Open the database MSCRM_CONFIG and run the query below :

update ConfigSettings set HelpServerUrl = 'https://crm.yourcompany.com'

vendredi 31 mai 2013

How to solve the problem of Dependent Picklist in CRM 2011 in Chrome



To manage the dependent picklist on Dynamics CRM 2011 we installed this  feature : http://blogs.msdn.com/b/paf/archive/2011/04/21/how-to-easily-create-dependent-picklist-in-crm-2011.aspx .

But since we updated CRM to authorize the users to use it in Chrome , we have an javascript error in Chrome.

There was an error with this field's customized event.
Field:window
Event:onload

To solve this, I modified the web resource  gps_SDK.DependentOptionSet.js  .

This is my version, I hoppe this can help you.


// =====================================================================
//  This file is part of the Microsoft Dynamics CRM SDK code samples.
//
//  Copyright (C) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
// =====================================================================
// <snippetSDK.DependentOptionSet.js>
//If the SDK namespace object is not defined, create it.
if (typeof (SDK) == "undefined")
{ SDK = {}; }
// Create Namespace container for functions in this library;
SDK.DependentOptionSet = {};
SDK.DependentOptionSet.init = function (executionObj,webResourceName) {
 //Retrieve the XML Web Resource specified by the parameter passed
 var serverURL = Xrm.Page.context.getServerUrl();
 if (serverURL.match(/\/$/)) {
  serverURL = serverURL.substring(0, serverURL.length - 1);
 }
 var pathToWR = serverURL + "/WebResources/" + webResourceName;
 var xhr = new XMLHttpRequest();
 xhr.open("GET", pathToWR, true);
 xhr.setRequestHeader("Content-Type", "text/xml");
 xhr.onreadystatechange = function () { SDK.DependentOptionSet.completeInitialization(executionObj,xhr); };
 xhr.send();
};
SDK.DependentOptionSet.completeInitialization = function (executionObj,xhr) {
 if (xhr.readyState == 4 /* complete */) {
  if (xhr.status == 200) {
   var JSConfig = [];
   var ParentFields = xhr.responseXML.documentElement.getElementsByTagName("ParentField");
   for (var i = 0; i < ParentFields.length; i++) {
    var ParentField = ParentFields[i];
    var mapping = {};
    mapping.parent = ParentField.getAttribute("id");
    mapping.dependent = SDK.Util.selectSingleNode(ParentField, "DependentField").getAttribute("id");
 var dependentPicklist = Xrm.Page.data.entity.attributes.get(mapping.dependent);
   if (dependentPicklist == null){
      alert(mapping.dependent + ' not found on the form' );
      return;
   }
 if ( executionObj.getSharedVariable(mapping.dependent + '_Options') == null)
                     executionObj.setSharedVariable(mapping.dependent + '_Options', dependentPicklist.getOptions());
    mapping.options = [];
    var options = SDK.Util.selectNodes(ParentField, "Option");
    for (var a = 0; a < options.length; a++) {
     var option = {};
     option.value = options[a].getAttribute("value");
     option.showOptions = [];
     var optionsToShow = SDK.Util.selectNodes(options[a], "ShowOption");
     for (var b = 0; b < optionsToShow.length; b++) {
      var optionToShow = {};
      optionToShow.value = optionsToShow[b].getAttribute("value");
      //optionToShow.text = optionsToShow[b].getAttribute("label");
   optionToShow.text = SDK.DependentOptionSet.getOptionSetLabel(executionObj,optionToShow.value,mapping.dependent); // Label is not used in the code.
      option.showOptions.push(optionToShow);
     }
     mapping.options.push(option);
    }
    JSConfig.push(mapping);
   }
   //Attach the configuration object to DependentOptionSet
   //so it will be available for the OnChange events
   SDK.DependentOptionSet.config = JSConfig;
   //Fire the onchange event for the mapped optionset fields
   // so that the dependent fields are filtered for the current values.
   for (var depOptionSet in SDK.DependentOptionSet.config) {
    var parent = SDK.DependentOptionSet.config[depOptionSet].parent;
    Xrm.Page.data.entity.attributes.get(parent).fireOnChange();
   }
  }
 }
};
SDK.DependentOptionSet.getOptionSetLabel = function (executionObj,value,dependentPicklistName)
 {
      var dependentPicklistOptions =executionObj.getSharedVariable(dependentPicklistName + '_Options');
      for (var i = 0; i < dependentPicklistOptions.length; i++) {
          if (value == dependentPicklistOptions[i].value) {
                return  dependentPicklistOptions[i].text;
            }
       }
       return '';
 };

 // This is the function set on the onchange event for
 // parent fields
SDK.DependentOptionSet.filterDependentField  = function (parentField, childField) {
  for (var depOptionSet in SDK.DependentOptionSet.config) {
   var DependentOptionSet = SDK.DependentOptionSet.config[depOptionSet];
   /* Match the parameters to the correct dependent optionset mapping*/
   if ((DependentOptionSet.parent == parentField) && (DependentOptionSet.dependent == childField)) {
    /* Get references to the related fields*/
    var ParentField = Xrm.Page.data.entity.attributes.get(parentField);
    var ChildField = Xrm.Page.data.entity.attributes.get(childField);
    /* Capture the current value of the child field*/
    var CurrentChildFieldValue = ChildField.getValue();
    /* If the parent field is null the Child field can be set to null */
    if (ParentField.getValue() == null) {
     ChildField.setValue(null);
     ChildField.setSubmitMode("always");
     ChildField.fireOnChange();
     // Any attribute may have any number of controls
     // So disable each instance
     var controls = ChildField.controls.get()
     for (var ctrl in controls) {
      controls[ctrl].setDisabled(true);
     }
     return;
    }
    for (var os in DependentOptionSet.options) {
     var Options = DependentOptionSet.options[os];
     var optionsToShow = Options.showOptions;
     /* Find the Options that corresponds to the value of the parent field. */
     if (ParentField.getValue() == Options.value) {
      var controls = ChildField.controls.get();
      /*Enable the field and set the options*/
      for (var ctrl in controls) {
       controls[ctrl].setDisabled(false);
       controls[ctrl].clearOptions();
       for (var option in optionsToShow) {
        controls[ctrl].addOption(optionsToShow[option]);
       }
      }
      /*Check whether the current value is valid*/
      var bCurrentValueIsValid = false;
      var ChildFieldOptions = optionsToShow;
    
      for (var validOptionIndex in ChildFieldOptions) {
       var OptionDataValue = ChildFieldOptions[validOptionIndex].value;
       if (CurrentChildFieldValue == OptionDataValue) {
        bCurrentValueIsValid = true;
        break;
       }
      }
      /*
      If the value is valid, set it.
      If not, set the child field to null
      */
      if (bCurrentValueIsValid) {
       ChildField.setValue(CurrentChildFieldValue);
      }
      else {
       ChildField.setValue(null);
      }
      ChildField.setSubmitMode("always");
      ChildField.fireOnChange();
      break;
     }
    }
   }
  }
};
SDK.Util = {};
//Helper methods to merge differences between browsers for this sample
 SDK.Util.selectSingleNode = function (node, elementName) {
  if (typeof (node.selectSingleNode) != "undefined") {
   return node.selectSingleNode(elementName);
  }
  else {
   return node.getElementsByTagName(elementName)[0];
  }
 };
 SDK.Util.selectNodes = function (node, elementName) {
  if (typeof (node.selectNodes) != "undefined") {
   return node.selectNodes(elementName);
  }
  else {
   return node.getElementsByTagName(elementName);
  }
 };
// </snippetSDK.DependentOptionSet.js>