Monthly Archives: December 2009

Dynamics NAV code for string replace

A simple but useful NAV (Navision) string function for replacing all occurrances of any substring with any new string.

STRREPLACE(String : Text[256];Old : Text[256];New : Text[256]) : Text[256]
Pos := STRPOS(String, Old);
WHILE Pos <> 0 DO
BEGIN
String := DELSTR(String, Pos, STRLEN(Old));
String := INSSTR(String, New, Pos);
Pos := STRPOS(String, Old);
END;
EXIT(String);

(Just declare a local variable Pos as Integer.)

Error installing Dynamics CRM client

If you recieve this errormessage:

*Microsoft CRM client requires Microsoft Office Outlook. Please install the current version of Microsoft Office Outlook.

Try this solution:

We had a similar issue with Outlook installed via group policy. The fix/work around was this.
Under HKCU\Software\Microsoft create a registry entry for MSCRMClient Under MSCRMClient create a new reg_dword key called "IgnoreChecks" Make the value 1
Re-run the installation. You will get the same error, however the Next button will be available and the install should complete without errors.

WCF MaxItemsInObjectGraph

How to set the MaxItemsInObjectGraph configuration.

Symptoms/Exceptions:

("System.Runtime.Serialization.SerializationException : Maximum number of items that can be serialized or deserialized in an object graph is ‘65536’. Change the object graph or increase the MaxItemsInObjectGraph quota.").

"System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly"

Solution

You need to modify both the configuration file for the service as well as the client.

For the services configuration should look like this:

Umea.se.EventReactor.ServiceTier.ServiceViewEventBehavior">name="Umea.se.EventReactor.ServiceTier.ServiceViewEvent">

maxItemsInObjectGraph="2147483647" />

The client configuration should look like this:

behaviorConfiguration="ServiceViewEventBehavior"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServiceViewEvent"
contract="ServiceReferenceViewEvent.IServiceViewEvent" name="WSHttpBinding_IServiceViewEvent">