Hi All,
I am trying to download file from SharePoint Online to NAV 365 BC 130 and if run following code I get an error. Upload file to SharePoint works fine but download file not. Please, Does anyone have experience with this, or could someone advise what is wrong and how to fix it? I'm really helpless now
Thanks a lot,
Dominik
ClientContext := ClientContext.ClientContext('SITE URL');
Account := 'USER ACCOUNT';
SecureString := SecureString.SecureString();
Password := 'PASSWORD';
FOR i := 1 TO STRLEN(Password) DO BEGIN
SecureLetter := Password
;
SecureString.AppendChar(SecureLetter);
END;
SharePointClientCre := SharePointClientCre.SharePointOnlineCredentials(Account,SecureString);
ClientContext.Credentials := SharePointClientCre;
String := 'FILE URL';
ClientFile := ClientContext.Web.GetFileByServerRelativeUrl(String);
ClientContext.Load(ClientFile,Expression);
ClientContext.ExecuteQuery;
ClientContext DotNet Microsoft.SharePoint.Client.ClientContext.'Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
NetworkCredential DotNet System.Net.NetworkCredential.'System.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
SharePointClientCre DotNet Microsoft.SharePoint.Client.SharePointOnlineCredentials.'Microsoft.SharePoint.Client.Runtime, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ClientFile DotNet Microsoft.SharePoint.Client.File.'Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
SecureString DotNet System.Security.SecureString.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
String DotNet System.String.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Expression DotNet System.Linq.Expressions.Expression.'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Password Text
SecureLetter Char
Account Text
Answers
However whatever u facing it wont work from NAV Side, That load class is getting inherited within which NAV Compiler wont understand.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
I am getting issue with this statement :- ClientContext.Load(ClientFile,Expression);
I am getting below error during runtime:-
A call to Microsoft.SharePoint.Client.ClientContext.Load failed with this message: The type of one or more arguments does not match the method's parameter type.
Do anyone can help me out here by passing the 2nd parameter correctly?