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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Open local file location from form

(0) ShareShare
ReportReport
Posted on by

My goal is to be able to browse to a local or server file from inside of the form. Ideally it would be dependent on the individual forms.

For example - when someone creates a new form one of the options is to add a link to that file location then when they save you can click that and open a windows browser file to that location. 

I've tried to do it as a webresource from this tutorial: http://blog.zealots.solar/?p=54

But I just get the javascript on the screen rather than the icon or a button. 

Does anyone have any idea how to accomplish this? 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    NicksTuk Profile Picture
    1,833 on at

    make sure the web resource is html, not text.

    From a design point of view, I would build the functionality with a data grid and a load (button/path field) control in a web resource, with data writing to a custom entity(table) and relating it to each record. That way you can add multiple documents to a form, and you have a way to report on the relationship of documents to a record.

    You can also skin it to look like standard CRM or a different control, highlight specific documents by importance, etc...

  • Community Member Profile Picture
    on at

    Nicolae, 

    The web resource is html and I also attempted to just put in

    <html>
    <head>
    <meta charset=”utf-8″ />
    </head>
    <body>
    
    <button onclick=”window.open(‘file://C:\Users\MReed\Documents)”>Click me!</button>
    
    </body>
    </html>

    and even then I only see the code and not a button. Does this have something to do with working in a sandbox?

    How would you relate the local files? Ideally I'd like to be able to open and go through local files without having to upload them to the CRM system. 

  • Suggested answer
    Javed Iqbal Profile Picture
    85 on at

    Hi

    Problem is when you create an HTML web resource you have two tabs in the text editor provided at the time of web resource creation. Make sure you are writting coude in the source tab not the RTF tab.

    I hope it helps.

    i had an html web resource with a link and image in it. this html was being showed in the form same problem as you are experiencing. I solved it by the desciption  i mentioned above

    i hope it will help.

  • Verified answer
    Tim Dutcher Profile Picture
    2,100 on at

    I just implemented this for a client. Here are the components:

    • Windows Service on their file server to create the folders. The service checks for create/update of specific entities and creates folders accordingly. Service also updates a "File Folder Path" field on the entity or entities.
    • JavaScript on the forms to run OnLoad. The code uses setInterval to refresh the HTML web resource (see below) until the file folder path is shown.
    • HTML web resource to query for the file folder path and display it. The path, in my case, needed to be prefixed with file:// so the full path would be something like file://redmond17/projects/A01.  This web resource uses the Web API to retrieve the file folder path once it has been saved to the record.

    So, in runtime, a user creates a Project record and saves. An auto-number is applied. The Windows Service creates the folder and updates the Project record. JavaScript is running for the form and is refreshing the HTML web resource (setting the src property) until the file folder is shown to the user. The user can then click the path to open the folder location.

    Note that opening Windows Explorer on click only works in Internet Explorer, but that's all our client uses so they're in luck.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans