1. Jeffrey Miller
  2. PowerBuilder
  3. Tuesday, 7 July 2020 23:13 PM UTC

I am running PowerBuilder 2017 R3. I am writing a routine that retrieves a link to a file that the user selects by clicking on a row in a datawindow. It is supposed to open the file dialog and save the file where ever the user selects. The link works when I send it to someone in and email and they click on it. It doesn't work when I use GetContextService and HyperlinktoURL. I get an error that says "Can't reach this page."

Any advice would be appreciated.

Thanks,

Jeff

Jeffrey Miller Accepted Answer Pending Moderation
  1. Wednesday, 8 July 2020 20:05 PM UTC
  2. PowerBuilder
  3. # 1

Chris,

I found that the URL being returned from GetResponseBody() had forward slashes in it wherever there was a backslash. Once I removed all the "\" characters, the dialog boxes for saving the file opened correctly. Is there a parameter that would return the URL without the "\" character?

Thanks,

Jeff

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 8 July 2020 20:48 PM UTC
No, not that I know of. However, the Pos() and Replace() commands could be your friend here. ;-)
  1. Helpful
  1. Jeffrey Miller
  2. Wednesday, 8 July 2020 21:14 PM UTC
Yes, the string functions worked for me. Resolved. Thanks!
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 July 2020 17:26 PM UTC
  2. PowerBuilder
  3. # 2

Hi Jeffery;

  Thank you for the Test Case App but it errors out on with a RunTimeError exception as follows:

Regards ... Chris

Comment
There are no comments made yet.
Jeffrey Miller Accepted Answer Pending Moderation
  1. Wednesday, 8 July 2020 15:12 PM UTC
  2. PowerBuilder
  3. # 3

Chris,

The pbl, pbt, and pbw are attached in the zip file. The main code is under the Rest button clicked event and dw_2 clicked event.

Thanks,

Jeff

Attachments (1)
Comment
There are no comments made yet.
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 8 July 2020 11:16 AM UTC
  2. PowerBuilder
  3. # 4

Don't know if this might be the problem, but make sure your hyperlink string includes a starting and ending double quote:

 

From our code:

string ls_url = "https://www.google.com"

// v5.3 added for chrome
ls_url = '"'+ls_url +'"'
lnet_base.HyperlinkToURL( ls_url )

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 July 2020 23:46 PM UTC
  2. PowerBuilder
  3. # 5

Hi Jeffery;

  Do you have a simple Test App that you can post that trys to perform this task so that we can check your code?

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.