Focal Point
[SOLVED] Maintain Web Link and Function in the same event

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3841008892

September 09, 2008, 12:26 PM
brjohnson
[SOLVED] Maintain Web Link and Function in the same event
Hello All,

Is there a way to launch a .fex using a web link from Maintain, and then run a maintain function after the .fex is ran from one single event handler. We are sending a list of orders to someone, and we don't want to send duplicate orders. They have asked that I flip a status field in the order record once the .fex has been ran. This will insure that each record only shows up one time. I can't seem to figure out how to call this function from the same event that launches the web link. Does anyone know how I can do this? Or some other method of launching a .fex in a new window and calling a function from one single user action?

Thanks,
Bryan

This message has been edited. Last edited by: brjohnson,


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
September 09, 2008, 01:37 PM
Dave Ayers
Bryan,

Could you use a regular Maintain trigger, and in the triggered case:

Case trigger

EXEC somefocexec

Update statusfield

code to notify user of actions

Endcase


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 09, 2008, 01:59 PM
brjohnson
Thanks for responding Dave,

That would work fine, but I do not know how to launch a .fex in a new window using the EXEC command. All the documentation about the EXEC command details how to use the results inside of the Maintain app, but I want to open the .fex in a new window. Can you point me to some documentation that would help?

Thanks


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
September 09, 2008, 02:34 PM
GamP
Bryan,

That is a thing that can be done in maintain, but not with 'standard' maintain actions.
What I did to accomplish this is to create the url for the fex to be executed and store it in a hidden field on the form. Next thing I did was to create a javascript and associate it with the form. The javascript checks to see if the hidden url field is not blank and if that is the case, it opens up a new window and sets the location to the value of the url in the hidden field. Since the javascript is connected to the form, it will run when the form loads. The only drawback hat I've not been able to overcome is that the new window with the result of the focexec is always in the background. Maintain puts its own window in front of it, even though the new window is created after the maintain window. I solved that by putting the result of my fex in an iframe on the maintain window, but maybe you can come up with a better solution that fits your own situation best.

Hope this helps a bit ....


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 09, 2008, 03:31 PM
Dave Ayers
Bryan,

You could also create a new Form with an HTML Table bound to a new stack that you define to receive the contents of your FORMAT HTMLTABLE report focexec. One field with a format of A256, or maybe A0, should do it.

Then you can open the form to display the report, and provide a close button to return to the main form.

Or, use an iframe as GamP suggests.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 11, 2008, 05:21 PM
brjohnson
Thanks for your replies,

I decided to just write the entire event in JavaScript.
    
   randomNum = Math.random();
   sURL = "/ibi_apps/WFServlet?IBIF_ex=book_orders_review_summary&IBIAPP_app=bookorderform bookorderform&num=" + randomNum;
   window.open(sURL);
   IWCTrigger("FlagOrders"); 

This seems to be working fine with my testing. I was wondering though if this would possibly cause problems if I was working with larger data sets? What would happen if I had thousands of records instead of less than 100? Could FlagOrders( ) execute while the report was still gathering data?


Bryan Johnson
WebFOCUS 7.7.03
Maintain
Win 7
Excel, PDF, HTML
September 12, 2008, 02:40 AM
GamP
Technically there would not be any problem with that, they are two different and 'unrelated' processes. They do both consume resources though, so they will share those.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 12, 2008, 03:20 AM
<JG>
Bryan,

I would have thought that the simplest approach would be for your report fex to also update
the flag

1. Table file extract data and hold it
2. maintain update flag based on extracted data
3. generate report based on hold data