Notifications
Announcements
No record found.
Hello,
I'd want to import files (Excel) from Sharepoint and was wondering if there are any useful x++ documentations for working with files.
I'd want to do the following:-Using x++, download a file(Excel) from SharePoint and extract data from it-create folders In SharePoint.-Place files in the sharepoint folder-Generate a text file (.txt).
thank you.
Maybe you could reuse existing functionality for this purpose. Document management and electronic reporting support SharePoint.
For example, look at Docu::GetStorageProvider() (with DocuFilePlace::SharePoint). The provider is also used by ERFileDestinationSharePoint class.
Thank u goshoom
I attempt to utilize them, but it's not that evident. Also I'd want to know where I can find any relevant information about working with files, as well as whether I need to use dotnet builtin packages.
Hi Saoudi,
You describe a process where a file is taken from SharePoint, convert it to another format an save it again in SharePoint. Tools like Power Automate and Logic Apps will do the job more easily with configuration instead of development in Dynamics 365.
thank u Andre Arnaud de Calavon
Because the customer does not want to operate with Power Automate or Logic Apps, I must use X++.
I'm not sure what you mean by dotnet builtin packages, but you'll indeed need .NET in some way. Either you'll utilize the Dynamics libraries that Microsoft uses, or you'll use SharePoint libraries directly, or you'll use libraries for HTTP communication.
By the way, trying to avoid using existing Azure resources becomes less and less feasible. It will be wise if your customer learn how to use cloud resources rather then rejecting them. Not only that reiventing the wheel is expensive, but many things will become impossible, although they're rather easy if you utilize available tools.
In case any one want to get a file from sharePoint U need to use the namespace Microsoft.Dynamics.Platform.Integration.SharePoint
I wish this code help
using SP = Microsoft.Dynamics.Platform.Integration.SharePoint; class SPclass { /// /// Runs the class with the specified arguments. /// /// The specified arguments. public static void main(Args _args) { System.UriBuilder builder = new System.UriBuilder("xxxxx.sharepoint.com/sites/mysite"); str host = builder.Host; System.Uri uri = new System.Uri("https://xxxxxx.sharepoint.com/sites/mysite/_api/web/" "GetFileByServerRelativeUrl('/sites/mysite/Documents partages/Fichier XLSX/IN/myfile.xlsx')/$value"); str extId = xUserInfo::getExternalId(); SP.SharePointProxy proxy = SP.SharePointHelper::CreateProxy(host,'/sites/mysite', extId); str token = proxy.AccessToken; SP.FileResults FileResults = new SP.FileResults(); SP.FileContents File; if(SP.SharePointHelper::VerifyAuthentication(proxy)) { //Method 1 memoryStream = SP.SharePointHelper::GetFiles(proxy,"Documents partages/Fichier XLSX/IN",""); System.Collections.IEnumerable results = FileResults.Results; var fileListEnumerator = results.GetEnumerator(); while (fileListEnumerator.MoveNext()) { SP.FileResult fileResult = fileListEnumerator.Current; } //Method2 File = SP.SharePointHelper::GetFileContents(proxy, Uri, true); } } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 646 Most Valuable Professional
André Arnaud de Cal... 529 Super User 2025 Season 2
Sohaib Cheema 285 User Group Leader