September 19, 20169 yr Newbies Everyone, I am working on migrating from filemaker server 12 with IWP. I currently use it on some iPods through safari. I am able to call a javascript function that correlates to a button on the layout to process a barcode scan. Example of that code: function iwpExecute(){ CancelEventPropagation.call(); top.iwp.executebuttonscript(176,'recnumField','recnumField'); } The 176 references a number assigned to the button on the layout. Calling this function in a webviewer worked perfectly for 5 years now. Moving on: Filemaker 15 Webdirect doesn't have a clear cut way of processing a script from javascript. I tried the http://wwww.example.com/fmi/webd#MyDB?script=Test This doesn't always take and it will frequently ask for a username and password over and over again. Which end users would hate. I would like to trigger the button with a javascript function to proceed processing. But Webdirect uses a ton of eventlisteners, but the one that gets triggered is an anonymous function with random letters and values in a return function. I tried .click() events, mousedown, mouseup, click simulations on the button( ref by element id) BUT NOTHING WORKS. Any advice on making a script in Webdirect run via javascript or otherwise but in a clean worry free manner? Thanks All!
September 19, 20169 yr The best way I've found to trigger a script to run on the client is to send a CWP request back to the server with the Persistent ID of the WebDirect client. From there, you can do the old "perform script on client" trick by deleting a record in a virtual window on the WebD session to get a script trigger to fire. From there, you are off to the races and can run whatever script you want. Takes a bit of setup, but works great in WebDirect. Trick is to open a new window and get to a "session" record, then bring another window to the front so that window is something the user never sees, but will still trigger a script onRecordLoad if the record gets deleted. Hope this helps Mike
September 19, 20169 yr Author Newbies Can you further elaborate on: "send a CWP request back to the server with the Persistent ID of the WebDirect client" and also on " old "perform script on client" trick by deleting a record in a virtual window on the WebD session"? Thanks for the help.
Create an account or sign in to comment