Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Posts: 63
Registered: ‎02-22-2016

Handle IG.downloadAndOpen() on fail

[ Edited ]

I am using IG.downloadAndOpen() function to open documents in my workflow.


I tried following Code

<FormAction name="openDrawing" label="Open Drawing" visible="form" action="SCRIPT[IG.downloadAndOpen('file:'+{FORM.PDF_NAME}).fail(function(){alert('Unable to Open PDF, '+{FORM.PDF_NAME})})]"></FormAction>


It opens the file if it exists, but doesn't show any alert on fail.


Is the way which I am handling it is right?

Where can I find documentation regarding IG.downloadAndOpen()?, I tried searching in "fluidtopics site"

Posts: 1,054
Registered: ‎10-18-2015

Re: Handle IG.downloadAndOpen() on fail

Hi Vipanth,


can you please try using IG.notify instead of alert? You might also test it on the external browser to check for any error in the Javascript console.




Stefano Turcato
Presale Engineer
Hexagon Geospatial
Posts: 63
Registered: ‎02-22-2016

Re: Handle IG.downloadAndOpen() on fail

Tried following definition


action="SCRIPT[IG.downloadAndOpen('file:'+{FORM.PDF_NAME}).fail(IG.notify('Unable to Open PDF, '+{FORM.PDF_NAME}).show())]"

That didn't work either.


The notify works fine when I tested it seperately. But not inside ".fail()"