newbaan
22nd July 2004, 05:16
am new to baanIVc4.I generated two sessions one is for maintain and one for print. Now I want initaite the print session thru maintaion session.
in maintaion session tool bar,one print button is there.When I click the print button I want to show the print session.How to enable the print button.
and in which secion I have to write the code to achieve this.,

rgds,
newbaan

klixy23
22nd July 2004, 09:12
Enable printing in form standard options to get the printer button work and add a choice.print.data section to start your print session.

dorleta
22nd July 2004, 11:10
If you want to launch a report from a not report sesion see the include tccom0010. It give you a number of funtions no manage a report.

If you want to initiate another session ( it don`t main the kind) in: cont.process:
on.choice:
zoom.to$("my session",z.session,"","",0)

bdittmar
22nd July 2004, 12:55
Hello newbaan

You can do it like this:

choice.user.2:
on.choice:

if marked then
export("dhpur021.suno","suno.f")
export("dhpur021.suno","suno.t")
export("dhpur021.year","year.f")
export("dhpur021.qurt","qurt.f")
zoom.to$("dhpur0421m000",Z.Session,"zoom1","",0)
endif

Regards Bernd

vahdani
22nd July 2004, 18:11
Hi Bernd,

You can do it like this:

choice.user.2:
on.choice:

if marked then
export("dhpur021.suno","suno.f")
export("dhpur021.suno","suno.t")
export("dhpur021.year","year.f")
export("dhpur021.qurt","qurt.f")
zoom.to$("dhpur0421m000",Z.Session,"zoom1","",0)
endif


you can only "export" variables to a parent session. Here it is firstly a child session and secoundly it isn't even started yet when you "export"!. The child session starts first by calling the function "zoom.to$"!
Here the child session (our print session) should "import" the variables from its parent (our maintain session) on startup (in "before.program", "zoom.from.xxx: on.entry:" or "form.1:init.form:" sections).

GabrielVA
27th August 2010, 22:25
Does this look right?

choice.user0
on.choice:
zoom.to$("tdlit4506m000",Z.Session,"","",0)

Im trying to take a button (which is user0) and put it into the script to make it open another session. Ive placed it in the choice section ofthe script, but when I run debug I get an error.

Any ideas?

Thanks

bdittmar
28th August 2010, 13:41
Does this look right?

choice.user0
on.choice:
zoom.to$("tdlit4506m000",Z.Session,"","",0)

Im trying to take a button (which is user0) and put it into the script to make it open another session. Ive placed it in the choice section ofthe script, but when I run debug I get an error.

Any ideas?

Thanks

Hello,
what error is shown?

BaanERP Programmers Guide


zoom.to$()

--------------------------------------------------------------------------------

Syntax
string zoom.to$( string process(14), long zoomcode, string zoomname(18), string returnfld(18), long formpos )

Description
Use this to zoom to another session or menu.

Arguments
process
Specifies the name of the session or menu that must be started.

zoomcode
This can be either Z.MENU or Z.SESSION, depending on whether it is a menu or session that is being started.

zoomname
The name of the calling process. This is used in the zoom.from sections in the called process. If no name is provided here, zoom.from sections in the child session are not executed.

returnfld
Indicates the name of the variable to be returned by the function. It must be the name of a variable in the called process. If an empty string is specified here, the function returns the exit value of the zoom process. If the argument is not filled, the function returns nothing.

formpos
Specifies the form position for displaying the window. The default is 0


Note
This function is supported for backward compatibility only. In new applications, use start.session() instead.

Return value
The variable specified in the returnfld argument.


Zoomnane and returnfld are not set.

Regards

GabrielVA
30th August 2010, 13:31
Under the section here when i do a debug:
|****************************** choice section ********************************

choice.cont.process:
on.choice:
execute(print.data)

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
else
choice.again()
endif

choice.user.0:
on.choice:
zoom.to$("tdlit4506m000",Z.Session,"","",0)
endif


I get a display broswer with the following:

Wrning(5) Statement not reached:
1warning reported.

bdittmar
30th August 2010, 14:55
Under the section here when i do a debug:
|****************************** choice section ********************************

choice.cont.process:
on.choice:
execute(print.data)

choice.print.data:
on.choice:
if rprt_open() then
read.main.table()
rprt_close()
else
choice.again()
endif

choice.user.0:
on.choice:
zoom.to$("tdlit4506m000",Z.Session,"","",0)
endif


I get a display broswer with the following:

Wrning(5) Statement not reached:
1warning reported.

Hello,

"statement not reached" can be ignored.

Regards

mark_h
30th August 2010, 15:01
Well in the code displayed there is an extra endif that looks like it can be removed. It might just be what you pasted.

GabrielVA
30th August 2010, 17:27
YES! I removed the endif in my code and Ive almost got it! getting just one error in debug now, "suppressed due to -w option(s)"

|****************************** CHOICE SECTION ***************************

choice.user.0:
on.choice:
zoom.to$("tdlit4506m000", Z.session, prog.name$, "", 0)

GabrielVA
30th August 2010, 17:51
OK I think Im there, I removed the -w options in the compile files section, it shows a different warning now, return value of funtion "zoom.to.menu' ignored.

Also when I run the session, the button when clicked has this that pops up and im not understanding this:

Note: deliveries already invoiced, changing not allowed

mark_h
30th August 2010, 17:59
Yep - zoom.to returns a value, but you don't have to check it. Now the message in the program you zoom to is just a warning message stating the delivery (what you zoomed to) already has invoices so you can not change it. A standard type message I see on receipts and other type things where you cannot change them if they are completed(or closed).

Now one thing I usually do before zooming(and I can not answer for you since I do not know the session you are zooming to) is set the table fields so that the zoom session automatically finds the correct meeting. So for example if I was going to zoom to tiitm0101s000 I would set tiitm001.item right before I called the zoom. Then the subsession would pull up the correct item. Just thought I would mention this.

GabrielVA
30th August 2010, 19:05
Thanks Mark,

Im working with tdlit4505m000. Basically they use to have Q-Key that enabled a button on the screen to open a subsession. What I did was I copied the subsession and created a new session called 4506m000. Now, Ive added under the maintain forms (theres 3 forms btw) under the special options, a new form -specific option called users.0, Maintain Display Lines (to the 4506 session). From there, I added in my button and tied it to #48, user.0. Intresting enough however, under the application tab when I launch the 4505m session, it gives me a link that says Display Sales order lines, to 4506m, which is what I need. The button with the given code seems to give me that error without anyhting else opening at all. Any thoughts there? I was hoping to simply find the coding under the application tab and copy it so when clicked it will open, but Im not use to Baan, its new and Im still trying to understand a lot of it.