web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

read and delete images from sharepoint folder and add into D365 products with x++

(0) ShareShare
ReportReport
Posted on by 5

read and delete images from SharePoint folder and add into D365 products with x++

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,059 Super User 2025 Season 2 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    Hi Tamoor,

    What is your exact question? Where exactly do you need help? What are your current attempts and where do you get stuck?

  • huijij Profile Picture
    19,811 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    Hi sir,

    Please refer to the old thread about read and save files from/into SharePoint with X++:

    community.dynamics.com/.../how-to-read-and-save-files-from-into-sharepoint-with-x

  • Tamoor Khalid Profile Picture
    5 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    Hi Judy,

    Yes I followed this thread, it is working fine for reading and deleting the files.

    but I am unable to createfile using  Microsoft.Dynamics.Platform.Integration.SharePoint.SharePointHelper::CreateFile(proxy,"xxxxxx.sharepoint.com/.../foldername","filename",memoryStream);

  • Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    We can't help you in any way if you don't explain your problem. There may be many reasons why you're unable to create a file and we can't know what's happening in your particular situation unless you tell us.

    For example, maybe you get a compilation error or an exception at runtime. Then share the information with us, such as what type of exception it is and what the error message says.

  • Tamoor Khalid Profile Picture
    5 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    Hi Martin
    I need to read the file(image) from Sharepoint folder i-e d365_product_images

    (xxxxxx.sharepoint.com/.../d365_product_images ), add that image into Release products in D365 F&O => this is already been achieved.

    Next step is to create same file(image) into another folder on sharepoint  i-e archive_product_images (xxxxxx.sharepoint.com/.../archive_product_images).

    While creating file in archive_product_images, it gives me access denied exception. I am able to access this folder while ready, and shared user has admin access.

    2450.sharepoint.png

  • huijij Profile Picture
    19,811 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    There are many scenarios that can prompt one of these messages "Access Denied". The most common cause is that permissions for the user or administrator are configured incorrectly or not configured at all. You can follow the troubleshooting in MS document:

    learn.microsoft.com/.../access-denied-or-need-permission-error-sharepoint-online-or-onedrive-for-business

  • Tamoor Khalid Profile Picture
    5 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    hi Judy,

    Thats what I understood when I got this error. But this is not the case, user has full access because I am able to delete files in this folder using code.

    SP.SharePointHelper::DeleteFile(proxy,"xxxxx.sharepoint.com/sites/d365_products_image/archive_product_image",fileResultv1.Name,memoryStream122);

  • Martin Dráb Profile Picture
    236,953 Most Valuable Professional on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    Does the folder exist?

  • Tamoor Khalid Profile Picture
    5 on at
    RE: read and delete images from sharepoint folder and add into D365 products with x++

    yes Martin, this folder does exist.

    folder path "xxxxx.sharepoint.com/sites/d365_products_image/archive_product_image" in this line of code,  

    SP.SharePointHelper::DeleteFile(proxy,"xxxxx.sharepoint.com/sites/d365_products_image/archive_product_image",fileResultv1.Name,memoryStream122);

    does this folder path has the right format?

  • Pirkino Profile Picture
    2 on at
    read and delete images from sharepoint folder and add into D365 products with x++
    Hi Tamoor, could you please tell us, did you resolve this problem or not ? 

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 696 Super User 2025 Season 2

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 569

#3
Martin Dráb Profile Picture

Martin Dráb 551 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans