Expand my Community achievements bar.

dynamic data population in subform by selecting radio button

Avatar

Level 2

Hi,

I want to retrieve a file which is present in server/local drive by clicking the hyperlink/button in designer .

I am taking a sub form which the data will be populated through web services if there are 2 names it will display as below and if there are 10 names it will display 10 different names adjacent to 10 different file with their location.

By clicking the url it should open the required PDF/file

eg:

Name        URL

aaaaa         c:\aaa.pdf

bbbbbb       C:\bbb.pdf

My question is:

1. how do we open files which are present in particular location , I  had tried with  followingcode in  Click event by making button hidden but didn’t work

xfa.host.gotoURL("C:\Documents and Settings\Desktop\Subba.txt");

app.openDoc("C:\Documents and Settings\Desktop\Subba.txt");

Please let me know what is wrong in my code

1 Reply

Avatar

Former Community Member

It is against the security model to open a file without the users knowledge (i.e. automated from a command). The app.launchURL command will ony work with an HTTP reference and the app.OpenDoc will allow you to open a PDF but it will prompt the user telling them that you are trying to open another file - click OK if you trust the site. I assume the txt extensions in your examples are a typo and that you are really trying to open PDFs.....right?

Paul