Focal Point
[Solved] Passing parms to a Maintan

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

September 23, 2008, 04:39 PM
Dave Ayers
[Solved] Passing parms to a Maintan
I need to run a Maintain program from a link in a report focexec, and pass two values to position the maintain to the specific record.

In researching the parameter passing business, I found a number of different approaches to retrieving the parameters, and am asking here which is the best method ?


1) IWC.GetAppCgiValue("InputName")

2) Sys_Mgr.Get_NameParm or Sys_Mgr.Get_PositionParm

3) MAINTAIN FILE IBFFCAST FROM CustSelected ProdSelected

and use CustSelected as needed...

Also, any advice on the proper form of the drilldown URL ?

This message has been edited. Last edited by: Dave Ayers,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 24, 2008, 03:48 AM
GamP
Dave,

I'd use the first one, IWC.GetAppCgiValue("param").
This seems to me to be the best way when dealing with url variables.
The drill down url can be constructed from within DevStudio, but if you need to do this manually it will have to contain the command to run the maintain as well as all parameters that are needed to start the maintain in good order as well as the parameters to be passed on to the maintain itself.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 24, 2008, 12:40 PM
Maintain Wizard
As for the drilldown code, I usually let the report painter build it:

TYPE=DATA,
COLUMN=N1,
URL=/ibi_apps/WFServlet?(xxx=N1 IBIF_cmd='MNTCON EX mnt1' IBIS_passthru='on' IBIS_connect='on' IBIAPP_app='cloop baseapp' IBIC_server='EDASERVE'),
$

Just make sure, that when you use: IWC.GetAppCgiValue("InputName") to get the value that InputName is EXACTLY coded the way it is passed.

Mark
September 24, 2008, 06:16 PM
Dave Ayers
Ah, OK I have my maintain running from a drilldown link in a report focexec, and accepting the parameters passed from it. Yea !

Thanks, GamP and Mark !

But I noticed another problem.

When the user is finished doing their updates and clicks the 'Close' button on the form (Mnt. self.WinExit(); handler), the maintain quits, but leaves the browser window open, with a login screen showing.

The user is probably accustomed to closing WebFocus windows with the upper right hand 'x' box. I don't want them doing the same with the maintain window to prevent orphan agents, but I'm sure they will when they get tired of clicking my Close button and then having to dismiss the useless window too.

So, how can I close the Maintain app AND close the browser window programaticly ?

(note: I did do a FP search for this, but nothing worked here)


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 25, 2008, 09:25 AM
GamP
Dave,

Under your Close button code the following:
(be sure it is a javascript event handler...)
window.close();
IWCTrigger("WINEXIT");

Type it as shown here, including upper/lower casing.
This should take care of your problem.

Then, there is the possibility that you will get a warning to the effect that the application has been closed. You can prevent this by including the statement MNTCON EXIT_WARNING OFF in your edasprof.prf file.

Hope this helps...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 28, 2008, 11:26 PM
Dave Ayers
I have tried the

" window.close(); IWCTrigger("WINEXIT"); " (empty browser window remains)

and the

" WINFORM SET form.XBUTTON.FOCUS to here; " (have to click the CLOSE button twice)

closing methods, but neither of them work for me ???

I am getting the Appl. close warning even with a
" Sys_mgr.focset("maintain_warning", "off"); " statement in Top case.

In addition, and more important, when I try to save a record (which is the first communication back to the server after the first Maintain page displays) I get a

" (FOC03847) RESUME: Application previously closed (no context). " error message, and no data is updated.

I have read about adding a random number to the maintain startup URL to control caching, but this maintain is started from a drilldown in a report focexec, in the form:

TYPE=DATA,
COLUMN=N4,
TARGET='_blank',
URL=/ibi_apps/WFServlet?(CustSelected=N1 ProdSelected=N4 IBIF_cmd='MNTCON RUN ibfprdfc' IBIS_passthru='on' IBIS_connect='on' IBIAPP_app='appdir baseapp' IBIC_server='EDASERVE'),
$

I can't see a way to add the random number to this drilldown link, or how to convert it to Javascript to use the exiting methods for that purpose.

I have a suspicion that this might be related to the closing problems, at least the FOC03847 error. (anyone know why that is the same error number for a Mnt. compile error ? )

While I have found some clues to these problems, here and the doc., they don't paint a full picture and seem to point in different directions. Can someone set me straight on maintain startup URLs and full closing ?

Thanks,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 30, 2008, 03:06 AM
GamP
Dave,

Put in the random number at the reporting level. That way each link in your report is a unique one and you just have to pass on the value of the 'noprint-ed' random number in the drill down.

As for the mntcon warning thing, put this statement in your edasprof file. My guess is that this variable needs to be set BEFORE the maintain starts. What you describes about the window behavior indeed sounds as if the warning has not been effected.

The message about the application previously having been closed very very probably comes form the fact that the maintain screen is displayed out of IE's cache, without ever actually having started the maintain. This is solved by adding the random number....

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 30, 2008, 03:52 AM
Dave Ayers
Progress - I changed the order of the close statements to:

IWCTrigger("WINEXIT");
window.close();

and now my maintains seem to close OK, except that I still get the warnings, even with the

Sys_mgr.focset("maintain_warning", "off");

The '(FOC03847) RESUME:...'errors are gone too, with the proper closing. Smiler

Any idea of what's wrong with the maintain_warning ?

And I'd still like to get a better idea of the differences between the various different ways of starting up maintains (drilldowns, vs Javascript URLs).

Thanks,


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
September 30, 2008, 10:09 AM
Maintain Wizard
To get rid of the warning message try this:

Include the statement MNTCON EXIT_WARNING OFF in your edasprof.prf file.

Mark
October 01, 2008, 01:26 AM
Dave Ayers
Ok, got the Exit_Warning in the server profile and now I only have to deal with the browsers warning message. It does make me wonder what good the Sys_mgr.focset("maintain_warning", "off"); is, if it doesn't do anything...

But, now all the basics are working and there are only a few little things to cleanup, so I think I can say Thanks to Mark and GamP and put a 'close' to this thread, hoping it can help others down the road.


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
October 02, 2008, 06:01 AM
GamP
Dave,

The browser's warning message can also be stopped. Searching through this forum gave me the answer to that. In the event handler for closing the window, just add the statement
window.opener=self;

just before actually closing the window. This will take care of the message.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
October 02, 2008, 04:19 PM
Dave Ayers
For lurkers and searchers:

The finial solution to getting a clean close from my maintain was to put the following into a Javascript event handler for your 'Close' button on your form.

window.opener='x';
IWCTrigger("WINEXIT");
window.close();

In addition you will need to add an

MNTCON EXIT_WARNING OFF

statement to your servers edasprof.prf file

That's what worked for me !


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server