My issue is in CRM 4.0
My problem was that in forms (edit.aspx) that includes attributes type date, sometimes cause the browser freeze and not responding , after 5 or 6 minutes I gets a global error alert (client - Ok Cancel dialogbox – not modal dialog !!! that Exception Accrued ….) , after hit on OK button I get an alert dialogbox that says "An error occurred while retrieving Date"
I have tried everything, including running the CRMTrace - didn't gets us any ideas …
We getting this exception jest in that cases:All Entities (Custom or not ) with date time (Jest Date Data) attributesAND The value of the date is DAY value <> MONTH value (NOT equal) All cases of date and month that equal like 1/1/yyyy , 2/2/yyyy … there will not be exception and the form will be loaded jest fine.
To make the problem more complicate, I will add the amazing fact that in Browser IE version 7 , this problem not accrued what so ever at all … Please don't respond that all clients should have IE 7 installed – because most of our clients (Intranet) have IE 6 , and I can't change it.
The solution
The solution for my problem, is not about a date format , but it was an issue of limitation of Internet Explorer that limits the number of simultaneous downloads to two downloads, plus one queued download – probably a crm form goes with AJAX to do something with date fields, and that limitation was stop it from working currect.
My solution was to increase that amount by using this :
How to configure Internet Explorer to have more than two download sessions
I'm sure everyone who developing WEB apps will find this article very interesting.
ItzikBS
Sep 26, 2008
Sep 22, 2008
How to manage configuration settings in workflow Activities / Plug-in in CRM 4.0
How to manage configuration settings in workflow Activities / Plug-in in CRM 4.0
This way(that recommended from Microsoft that comes with the registration tool) of manage configuration keys is very "strange" and most likely it is a "default option" – it seems to be that the team who developed the product (that there no question about it – it is a distributed system and it should act like it) forgotten what most developers will have to use: The ability to manage configuration keys and value that can be read and access from any context (Sync plug-in, A-Sync , Workflow activities or from yours ISV web site … ).
I don't want to paste for every step I have registered a string of XML , I want the ability to hold my keys in one place \ file \ table and that I can access it from any code that runs from at any context.
From my and our experience there few ways:
1. Use the default way and read keys from the string that provided with the registration steps Disadvantages: see the above …
2. Store it in a CRM entity and read it every time from the CRMDisadvantages: There is no Cache managed and every call or read key will get it by the SDK and from the DB – very low performance!!!
3. Using / Build a Central Configuration Manager that can be read and access at any time from any place and context.This can be achieve by developing a configuration utility that work against .Config file for any system and module.you can to the follow:Create a file name myApp.config and Store it in particular folderPoint the file from the local Machine.config.It will be available from any context , and by default it manage Cache with file dependency.
link to discussion with this issue:
http://blogs.msdn.com/crm/archive/2008/10/24/storing-configuration-data-for-microsoft-dynamics-crm-plug-ins.aspx
Thanks
ItzikBS
This way(that recommended from Microsoft that comes with the registration tool) of manage configuration keys is very "strange" and most likely it is a "default option" – it seems to be that the team who developed the product (that there no question about it – it is a distributed system and it should act like it) forgotten what most developers will have to use: The ability to manage configuration keys and value that can be read and access from any context (Sync plug-in, A-Sync , Workflow activities or from yours ISV web site … ).
I don't want to paste for every step I have registered a string of XML , I want the ability to hold my keys in one place \ file \ table and that I can access it from any code that runs from at any context.
From my and our experience there few ways:
1. Use the default way and read keys from the string that provided with the registration steps Disadvantages: see the above …
2. Store it in a CRM entity and read it every time from the CRMDisadvantages: There is no Cache managed and every call or read key will get it by the SDK and from the DB – very low performance!!!
3. Using / Build a Central Configuration Manager that can be read and access at any time from any place and context.This can be achieve by developing a configuration utility that work against .Config file for any system and module.you can to the follow:Create a file name myApp.config and Store it in particular folderPoint the file from the local Machine.config.It will be available from any context , and by default it manage Cache with file dependency.
link to discussion with this issue:
http://blogs.msdn.com/crm/archive/2008/10/24/storing-configuration-data-for-microsoft-dynamics-crm-plug-ins.aspx
Thanks
ItzikBS
Retrieving Many-to-Many Relationships
Hi,
I have Entity A that link to Entity A (Link to itself) with Many-to-Many Relationships,For example: I have entity "new_role" and it's can represent a role that is stands for one role , or it's can represent a Team that team can be 2 or more roles (Many-to-Many Relationships to the same entity).
I have try to retrieve (SDK) data by using the LinkFromEntityName but it's work fine jest between 2 difference entities – when I try to run the same logic to Many-to-Many Relationships to the same entity I got the Error that the attribute in the LinkFromAttributeName properties is not exists in the linkek entity
Here is the sample from SDK:
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0;
token.OrganizationName = "AdventureWorksCycle";
CrmService service = new CrmService();
service.Url = ""http://:/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Get the GUID of the current user.
WhoAmIRequest who = new WhoAmIRequest();
WhoAmIResponse whoResp = (WhoAmIResponse)service.Execute(who);
Guid userid = whoResp.UserId;
// Create a query expression.
QueryExpression qe = new QueryExpression();
qe.EntityName = "role";
qe.ColumnSet = new AllColumns();
// Create the link entity from role to systemuserroles.
LinkEntity le = new LinkEntity();
le.LinkFromEntityName = "role";
le.LinkFromAttributeName = "roleid";
le.LinkToEntityName = "systemuserroles";
le.LinkToAttributeName = "roleid";
LinkEntity le2 = new LinkEntity();
le2.LinkFromEntityName = "systemuserroles";
le2.LinkFromAttributeName = "systemuserid";
le2.LinkToEntityName = "systemuser";
le2.LinkToAttributeName = "systemuserid";
// Create the condition to test the user ID.
ConditionExpression ce = new ConditionExpression();
ce.AttributeName = "systemuserid";
ce.Operator = ConditionOperator.Equal;
ce.Values = new object[]{userid};
// Add the condition to the link entity.
le2.LinkCriteria = new FilterExpression();
le2.LinkCriteria.Conditions = new ConditionExpression[]{ce};
// Add the from and to links to the query.
le.LinkEntities = new LinkEntity[]{le2};
qe.LinkEntities = new LinkEntity[]{le};
// Retrieve the roles and write each one to the console.
BusinessEntityCollection bec = service.RetrieveMultiple(qe);
foreach (BusinessEntity e in bec.BusinessEntities)
{
role r = (role)e;
Console.WriteLine(r.name.ToString());
}
Thanks
ItzikBS
I have Entity A that link to Entity A (Link to itself) with Many-to-Many Relationships,For example: I have entity "new_role" and it's can represent a role that is stands for one role , or it's can represent a Team that team can be 2 or more roles (Many-to-Many Relationships to the same entity).
I have try to retrieve (SDK) data by using the LinkFromEntityName but it's work fine jest between 2 difference entities – when I try to run the same logic to Many-to-Many Relationships to the same entity I got the Error that the attribute in the LinkFromAttributeName properties is not exists in the linkek entity
Here is the sample from SDK:
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
token.AuthenticationType = 0;
token.OrganizationName = "AdventureWorksCycle";
CrmService service = new CrmService();
service.Url = ""http://
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Get the GUID of the current user.
WhoAmIRequest who = new WhoAmIRequest();
WhoAmIResponse whoResp = (WhoAmIResponse)service.Execute(who);
Guid userid = whoResp.UserId;
// Create a query expression.
QueryExpression qe = new QueryExpression();
qe.EntityName = "role";
qe.ColumnSet = new AllColumns();
// Create the link entity from role to systemuserroles.
LinkEntity le = new LinkEntity();
le.LinkFromEntityName = "role";
le.LinkFromAttributeName = "roleid";
le.LinkToEntityName = "systemuserroles";
le.LinkToAttributeName = "roleid";
LinkEntity le2 = new LinkEntity();
le2.LinkFromEntityName = "systemuserroles";
le2.LinkFromAttributeName = "systemuserid";
le2.LinkToEntityName = "systemuser";
le2.LinkToAttributeName = "systemuserid";
// Create the condition to test the user ID.
ConditionExpression ce = new ConditionExpression();
ce.AttributeName = "systemuserid";
ce.Operator = ConditionOperator.Equal;
ce.Values = new object[]{userid};
// Add the condition to the link entity.
le2.LinkCriteria = new FilterExpression();
le2.LinkCriteria.Conditions = new ConditionExpression[]{ce};
// Add the from and to links to the query.
le.LinkEntities = new LinkEntity[]{le2};
qe.LinkEntities = new LinkEntity[]{le};
// Retrieve the roles and write each one to the console.
BusinessEntityCollection bec = service.RetrieveMultiple(qe);
foreach (BusinessEntity e in bec.BusinessEntities)
{
role r = (role)e;
Console.WriteLine(r.name.ToString());
}
Thanks
ItzikBS
Subscribe to:
Posts (Atom)