Thanks for including the specific details about which versions of clients you are using -- that information helps. There are at least a couple solutions that might have been proposed that would have required later versions of FMP clients.
With respect to the target webviewer content which may or may not be present:
1) Is the content in the form of HTML pages? Links to raw image files? Links to some other kind of file? Varies depending on the current record?
2) Is the content all hosted on a single server, or is it on multiple servers?
3) Do you have control over the server(s) that host the content?
Here are some ideas of the top of my head:
1) Have you considered hosting a simple shim page using something like PHP, which:
- Accepts a query parameter of the target URL
- Checks to see if the resource exists
- If the resource exists, it returns a redirect command to the webviewer, pointed to the resource
- If the resource does not exist, it returns a custom error message?
4) You might be able to use a tiny (almost invisible) web viewer which attempts to load the resource, and if a 404 page is detected, the main webviewer that the user sees could be conditionally set to show your custom error message. This could be script driven. It may even be possible to get something working without scripting, and just using the calculation engine with the web-viewers. Were this v.12, you could use Insert From URL instead of a second webviewer.
If any of the above seem worth pursuing to you and you could use a nudge to get started, please just let me know, and I'll do my best to post some kind of sample if I know which direction you are interested in.
HTH & very best,
If you control the webserver which hosts all of the target content, you might be able to achieve what you want by using a custom 404 page.
Thank you for the extensive list of ideas and details.
The web viewer is just looking at images on a file server, via a web service. All of the images are jpg files. Each record in FM knows what the URL to the images is suppose to be, but if there is no file or image there as expected, the web service is displaying the error screen. I may be able to ask the web manager to change the error screen.
There are both Window and Mac users.
#4 sounds the easiest, but how would FM know the contents of the web viewer? Is there a way to "screen scrape" the content or detect the error?
I found the GetLayoutObjectAttribute function, which when retruning the "content", I was able to make the Web View give a blank image, instead of the error message.
I used the 2nd small web viewer to determine what the content was to check.
Thanks for your help.
Glad it worked out!
p.s. The dual webviewer option seems the simplest to me, too.
p.p.s. If the image file sizes are large, and this function is extensively utilized, then it may be worth keeping in mind that most of the solutions I posted use up almost twice the bandwidth and also increase the webservice workload, as every request is being made twice. The exceptions to this could be a well-implemented PHP shim or the option of getting the web manager to change the error screen.