GabrielVA
27th August 2010, 20:58
Hello all,
Im fairly new to Baan and trying to learn my way around it. Ive been tasked with taking a session and creating a button that when clicked will open another session. Can someone please give me some guidance here? Ive seen in Maintain forms there is a place for buttons but other than that, I don't have any idea what I should do.
Thanks
GabrielVa
günther
30th August 2010, 09:41
Hi,
there are two possibilities:
1. You can add one sesssion or one menu (with many sessions) to the choice field; this method is okay if you want to custom e.g. baan standard sessions or if you have lots of different sessions that you want to start. But sometimes its a bit difficult when you want to start the next session with specific parameters.
2. You can add up to 10 form specific commands (Number 48 = user.0 to 57 = user.9). These will activate the "Special" menu command of your session. If you like, you can also add it as a button. And you will have to code, at least something like:
choice.user.0:
on.choice:
| maybe some parameter passing, e.g. zoom.item = form.item
zoom.to("<your.session.code>", z.session, prog.name$, "", 0)
Btw. I'm using prog.name$ here, so that the "zoom.from" section of the called session gets activated.
Günther
GabrielVA
30th August 2010, 18:05
Hi Günther,
Thanks, I believe that #2 is what Im looking for. This is what I have in my code and when I debug it gives me errors.
|****************************** DECLARATION SECTION ***************************
declaration:
table ttdsls040 |Sales Order Header
|#parent
|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION **************************
|****************************** CHOICE SECTION ***************************
choice.user.0
on.choice
zoom.to("tdlit4506m000", z.session, prog.name$, "", 0)
|****************************** FIELD SECTION ***************************
|06.30.04 wendy - added the following
field.tdsls040.cbrn:
check.input:
if isspace(tdsls040.cbrn) then
set.input.error("tdsls4101.1")
|"Line of Business cannot be blank"
|#call
endif
|06.30.04 wendy - end of addition
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
choice.user.0 not expected.
on.choice not expected
zoom.to not expected
GabrielVA
30th August 2010, 18:19
ok, I figured out most of the problems here, its my syntax.
choice.user.0:
on.choice:
zoom.to$("tdlit4506m000", z.session, prog.name$, "", 0)
the only error Im getting now is :
1 warning suppressed due to -w option(s).
mark_h
30th August 2010, 18:22
First - you are compiling with the -w option which supresses the warings. If your remove the -w from the script it will compile and print a warning. In most cases the warning can just be ignored.
GabrielVA
30th August 2010, 22:44
Gotcha! Im starting to get the hang of Baan, I really appreciate your help with this! I discovered that they were using Q-Key, which was broken when they did some osrt of patch or forklift upgrade of Baan a few years ago. I have since then abandoned this and simply added a menu button under Application which does what I need.
mark_h
31st August 2010, 19:53
Glad you got it. PS - with Qkey when you patch or something like that it has to be re-installed. We just had that happen a month or so to us.
babsal2006
9th February 2011, 09:24
Hi,
choice.user.0:
on.choice:
zoom.to$("tdlit4506m000", z.session, prog.name$, "", 0)
Can anybody replace the above statement in ERL LN FP6, using Form Commands...
Best Regards
Saleem
NirajKakodkar
9th February 2011, 13:07
choice.user.0:
on.choice:
zoom.to$("tdlit4506m000", z.session, prog.name$, "", 0)
Can anybody replace the above statement in ERL LN FP6, using Form Commands...
Best Regards
Saleem
In LN you just need to maintain the form command and describe the object to activate (session, funtion etc ).
If the the form command will activate a "function" you need to define the function as extern in your program script.
In the attached screenshot, I have maintained a form command to activate a function "make.exception.entry". In the detail of the form command you can specify whether to display the command as button or in specific menu.
Apart from this you just need to define the function as extern function in your program script.
function extern make.exception.entry()
{
............
}
babsal2006
12th February 2011, 10:30
Thak u for the reply.
Actually I was trying to validate my data before the control is transfered to the zoomed session.
I have achieved this by means of the following script.
choice.tdsls1501m000:
before.choice:
if <validation logic not passed> then
choice.again()
endif