Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
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
Categories:
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans