ltannous
19th May 2005, 21:04
I have created a print/update session that is activated from a main session. In the main session I dont have source code so I added my customized session to start by adding it to the choice field in my main session form.

How can I get my session to continue once the main session is completed.
Currently it completes the main session activity, then my session appears for the user to select continue. I want to bypass the contiue option and just have it activate.

mark_h
20th May 2005, 01:13
I did something like this once. Not sure if it will work for you:

form.1:
init.form:
if background then
execute(cont.process)
endif


In my case I knew when I zoomed to(or activated) the session I would be executing the code based on some import parameters.

mark_h
20th May 2005, 14:44
Not sure if I was real clear. This code would go into your custom session. I think(but am not positive) that background will be true when your session is activated. At that point this session would then execute the continue process.

ltannous
20th May 2005, 17:09
That worked.
Is there a way not to have my form display?
I tried to remove my form, but I get an error that the form is missing.

I actually want to remove the form and report and just use the program to update a table.

NPRao
20th May 2005, 20:07
You can make a session with 3-GL attached to it and use activate() or other functions to start the standard session and then do your processing.

mark_h
20th May 2005, 20:13
As NPR says you could make it a 3GL. My users like to know what is going on with processing. I have always left the form visible(with processing messages). That gives them a warm fuzzy feeling.

NPRao
20th May 2005, 20:17
As Mark said, you can use display fields on form to show what's happening or use progress indicators (search for the other threads on board for your BaaN Version).

lbencic
20th May 2005, 21:39
They may not want to make it 3gl - they may want to use the same session / logic that they use as an interactive session.

One thing we use in our ddc code is the variable sattr.slave:


if background then
sattr.slave = true
execute(cont.process)
endif


and this seems to make the form not appear. You can try that, I think it's standard (or we wrote something buried that I am not aware of...) Let us know if that works.

lbencic
20th May 2005, 21:43
Actually, sattr.slave should go in the before program, not the init.form section.

mark_h
20th May 2005, 22:18
None of the help on our systems has that predefined variable. I did compile a program just see if it worked on our release of 4c4 and it did. Learned something new today - thanks Lisa. I can go home and feel like I was successful(for at least one day). :)

Hitesh Shah
24th May 2005, 18:37
That worked.
Is there a way not to have my form display?
I tried to remove my form, but I get an error that the form is missing.

I actually want to remove the form and report and just use the program to update a table.

Besides 3GL program , u can also write the code to update a table in the before.program of ur 4GL session and exit the sesison (end() / stop() .. ) in before.program section after table is updated . In this way the form will not be displayed to the user even in 4gl program.

ltannous
25th May 2005, 23:13
I went with a few of the options. I took the sugesstion to run the progess bar on the form for the users "comfort".

I have another issues now. When I set my customized session to run from the main session using the choice option in the main session form, once my session has completed its task, if I click with my mouse anywhere on the main sesison form, my session gets activated again. How can I prevent this from happening.

Is there any way to exit the main session when my session has completed its task? without source code?

LittleJohn
26th May 2005, 06:24
dirty way... but you can. Import the "pid" value of the parent session in your customized session and once the process is completed... kill the parent and then kill your session.
Parent session wont exit "gracefully"...... but you can display a message to the user that the process is terminating.

Regards
LittleJohn

kathuria
26th May 2005, 10:16
Hi,

I have added one customize session in choice of main session. I want to activate customization session when exit from main session. I don't have code of main session. I have used procedure which is explained but not working.

Regards
Sanjay

ltannous
26th May 2005, 15:04
Hi,

I have added one customize session in choice of main session. I want to activate customization session when exit from main session. I don't have code of main session. I have used procedure which is explained but not working.

Regards
Sanjay
Add your customized session number in the choice option of the main session form. Make sure you dump the form.

ltannous
26th May 2005, 15:08
dirty way... but you can. Import the "pid" value of the parent session in your customized session and once the process is completed... kill the parent and then kill your session.
Parent session wont exit "gracefully"...... but you can display a message to the user that the process is terminating.

Regards
LittleJohn

How do I get the pid? Is the behaviour normal for the session to activate my customized session by clicking my mouse on any part of the main form?