Skip to main content

Notifications

Microsoft Dynamics GP forum
Suggested answer

Checking if a file exists in Sharepoint.

Posted on by 310
OK, here is one for the developers.
 
We have a custom Dexterity application that links to Dynamics GP via eConnect.
 
We have written a powershell script that we use to upload PDF and XLSX files from our file system to Sharepoint.
 
This script is called from the dexterity routine that generates the PDF file.
 
The issue we have is that sometimes, for whatever reason, the PDF file does not successfully load.
 
I currently do a File_Probe() on the file server to see if the PDF file exists.  If it does, I call the powershell script (converted to an exe) to upload to sharepoint.
 
I have the script logging the success or failure so I know why it is failing once or twice a day.
 
What I want to do is effectively do a File_Probe() on the Sharepoint URL/file to see if it exists and if it doesn't, rerun the process.  I will do this an an end of day scheduled routine within our Dexterity application.  
 
I am not sure of the best way to do this.  I know it can be done in Powershell, PowerAutomate, etc but I need it from within Dexterity so I can just rerun the existing upload routine.
 
Any help would be appreciated.
 
 
Mark
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,019 Moderator on at
    Checking if a file exists in Sharepoint.
    Hi,
    Maybe we would be in a better place to assist if you explain what the whole process purpose is and why you had to write a separate Dexterity code to perform this ? do you print bulk documents out of GP ? or generate XLSX files from GP with SmartLists that you want put on a SharePoint site ? 
    Have you thought about producing those files in SSRS and ship them automatically to the right location on the network in SharePoint ? I've done this in the past and works very well.. SSRS natively generates PDF or XLSX files and can send them on scheduled times. 

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans