Hi,
Apologies if this has been questioned or answered before, but couldn't find it in my search done earlier.
Looking at codeunit 9510 Document Service Management, we can see that the DotNet assembly variable named DocumentManagementHelper is first Reset and then methods can be called. We also see that DotNet variable DocumentService is instantiated through the DocumentServiceFactory.CreateService([service type]). Wondering if that "Reset" does the instatiating of a class, but surely the CreateService method seems to be doing it!
This is done from inside a codeunit like what I want to do, not from inside a page!
I am having serious trouble trying to develop a similar add-in in C# to do something else, from inside a codeunit. I'd need to determine certain string contents and then pass them as attributes (metadata columns) for a file at a time, stored in Sharepoint Online.
I did (and spent days!) looking at possibilities, tried public static class definitions to avoid instantiation, got issues to used the DocumentManagementHelper to provide the Credentials to connect to the SP server using the standard NAV document service definition, even bought advanced C/Al development books and all I found so far was client-oriented add-in development examples that rely on C# development of add-ins to use on NAV pages. Not in codeunits.
Sure that looking at codeunit 9510 we can determine that what I want to do must be possible.
Using NAV 2017 currently.
Help on this to put me on the right path would be warmly welcomed!
Cheers
*This post is locked for comments