Email Logging Credentials v Webcredentials Nav2017 CU 2.1

MauddibMauddib Member Posts: 269
edited 2017-02-15 in NAV Three Tier
I am having a separate issue with Email Logging now.

In marketing Setup you set the Queue/Storagepath as it was in Nav2015.

There are NEW fields now however for setting up the URL for exchange, and LOG IN Credentials.

If I leave the new Fields blank I CAN drill into the Queue/Storage Path and see all my "Public Folders".

If I fill the new Fields in incorrectly, I can not.

If I fill them in correctly, I CAN.

And when I select Queue/Storage Paths and use the Function "Validate Email Logging Setup" everything works fine!

NOW THE PROBLEM:

When I run Codeunit 5064 it says the folders do not exist. And I simply can not figure out why. The only thing I can see is that Marketting Setup Page 5094 uses a DotNet variable called Credentials "System.Net.NetworkCredential" while Codeunit 5064 used a variable called WebCredentials "Microsoft.Exchange.WebServices.Data.WebCredentials"

My error then comes here:

SetErrorContext(Text103);
IF NOT ExchangeWebServicesServer.GetEmailFolder(MarketingSetup.GetQueueFolderUID,QueueFolder) THEN
ERROR(Text002,MarketingSetup."Queue Folder Path");

We have Microsoft Exchange Server 2010 and do not have Microsoft Exchange Online. I was told you need one OR the other, but not both. But now I suspect the problem is you now need both???? Is this so? And if so would simply rolling back to the NAV 2015 version of CU5064 bypass this issue? Or is there another move I can make?

Best Answer

  • MauddibMauddib Member Posts: 269
    Answer ✓
    Ok so I solved this myself.

    The first issue seemed to be that when supplying the URL of the Exchange server I used HTTPS: At the beginning. This worked for the LOCAL log in credentials of the Marketing Setup Table. But it does not work for the WebCredentials Version in CU 5064. When I used the URL without the leading HTTPS it worked better.

    However I THEN started getting other failures in finding the Folder that was setup in Marketting Setup. I tracked it down eventually to a line in CU5321 - Initialize(). In this function we start with:

    IF ISNULL(Service) THEN
    Service := ServiceFactory.CreateServiceWrapper2013;

    Which seems to mean that Email Logging will only work for Exchange 2013??? Even though MS list the system requirements for it to be Exchange 2010 OR 2013.

    So I changed the code to:

    IF ISNULL(Service) THEN
    Service := ServiceFactory.CreateServiceWrapper;

    And things progressed further.

    I then had ANOTHER problem where there is new lines of code in CU 5064 LogMessageAsInteration() to get the "Web URL" of the email being logged. Once again I got an error message informing me that I had the wrong Exchange Version to be using the function "StorageMessage.LinkUrl" so I was forced to comment out these 4 new lines entirely.

    And now Email Logging is working "perfectly". Or as perfect as it can be given I had to decimate Navision Standard code to get there.

Answers

  • MauddibMauddib Member Posts: 269
    Answer ✓
    Ok so I solved this myself.

    The first issue seemed to be that when supplying the URL of the Exchange server I used HTTPS: At the beginning. This worked for the LOCAL log in credentials of the Marketing Setup Table. But it does not work for the WebCredentials Version in CU 5064. When I used the URL without the leading HTTPS it worked better.

    However I THEN started getting other failures in finding the Folder that was setup in Marketting Setup. I tracked it down eventually to a line in CU5321 - Initialize(). In this function we start with:

    IF ISNULL(Service) THEN
    Service := ServiceFactory.CreateServiceWrapper2013;

    Which seems to mean that Email Logging will only work for Exchange 2013??? Even though MS list the system requirements for it to be Exchange 2010 OR 2013.

    So I changed the code to:

    IF ISNULL(Service) THEN
    Service := ServiceFactory.CreateServiceWrapper;

    And things progressed further.

    I then had ANOTHER problem where there is new lines of code in CU 5064 LogMessageAsInteration() to get the "Web URL" of the email being logged. Once again I got an error message informing me that I had the wrong Exchange Version to be using the function "StorageMessage.LinkUrl" so I was forced to comment out these 4 new lines entirely.

    And now Email Logging is working "perfectly". Or as perfect as it can be given I had to decimate Navision Standard code to get there.
Sign In or Register to comment.