morpheus
11th November 2002, 09:29
Hello,
I would like to disable the Close (X) icon on the upper right corner of the BaaN session. Is it possible in BaaN IV c4? If yes, how!!?
Ilansu
11th November 2002, 16:41
You need to go to maintain form (ttadv3100m000).
Choose Stand. Opt..
Unmark from choice Exit . (choice 37)
Create form dump.
Ilan S
morpheus
11th November 2002, 18:33
Thanks.
But, I would like to disable "X" depending on some logic written in the program script. Is there any function or pre-defined variable that can be used!?
rupertb
12th November 2002, 10:29
The 'X' can be enabled/disabled programatically with a custom variable.
domain tcbool exit.allowed
before.program:
exit.allowed = false
field.user.password:
check.input:
if some.function() then
exit.allowed = true
else
exit.allowed = false
endif
choice.abort.program:
before.choice:
if not exit.allowed then
choice.again()
endif
Regard,
Rupert
zacharyg
12th November 2002, 14:23
try this ...
I believe g.exit.menu is the variable you're looking for.
morpheus
14th November 2002, 07:31
Rupert,
Thanks for the code! That anyway can be programmed. But, I was looking for some feature provided by the system.
Zach,
I tried using g.exit.menu . It did not give me any error, while compiling, but at the same time, it did not work!! It allowed to exit the session. I tried searching the library for this variable, but no success.
morpheus
20th November 2002, 10:46
Can anyone help me on this...!?
NPRao
20th November 2002, 10:54
morpheus,
I think its a good time to know why do you like to do that? whats the purpose/requirement of disabling the "X" ?
Thanks!
morpheus
20th November 2002, 11:19
Hello Rao,
It is HOW which is more important, and not WHY!!
Anyway, if you insist -
I have a main session where the user inputs some numeric value. From that main session, the users zooms to a sub-session. Here the user is supposed to enter the lines, and the number of lines should be ATLEAST the numeric value punched in the main session. I can use AFTER.SESSION, and give logic, but the section will not work if the user saves and clicks "X" or "EXIT" option!!
So, I would like to disable "X", if the number of lines are less than the numeric value, in the main session.
The "EXIT" option can be disabled from the "Standard Options", in Maintain Forms, but I would like to control this from the script.
NPRao
20th November 2002, 11:34
morpheus,
Did you try to use a set.input.error() { equivalent fieldname.check() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_dal_fieldname_check) which is a BaaN-5 valid function} else you can call the other tools function, check.all.input() in the choice.update.db & before.choice or before.write sections in BaaN-4 series.
You can also do some coding with the events to ignore the abort/exit options, please refer to - User interface objects: example (http://www.baanboard.com/programmers_manual_baanerp_help_functions_user_interface_objects_example)
That example code might help you to come up with a new idea.
function handle.event.loop()
{
long event(EVTMAXSIZE)
while TRUE
next.event(event)
on case evt.type(event)
case EVTMENUSELECT:
on case evt.menu.return(event)
case COMMAND.ABORT:
case COMMAND.EXIT:
return
case COMMAND.FIRST:
combox_id = 1
update.gwindow()
break
case COMMAND.LAST:
combox_id = 5
update.gwindow()
break
case COMMAND.PREV:
if combox_id > 1 then
combox_id = combox_id - 1
update.gwindow()
endif
break
case COMMAND.NEXT:
if combox_id < 5 then
combox_id = combox_id + 1
update.gwindow()
endif
break
endcase
break
case EVTPUSHBUTTON:
if ( evt.button.return(event) = COMMAND.ABORT OR
evt.button.return(event) = COMMAND.EXIT ) then
return
endif
break
case EVTLISTBOXSELECT:
combox_id = evt.listbox.item_id(event)
update.gwindow()
break
default:
break
endcase
endwhile
}
Good luck, I worked with BaaN-4 series long back and I do not have access to help you out much. :p
Ilansu
20th November 2002, 14:26
Morpheus,
Rupert reply was :
choice.abort.program:
before.choice:
if not exit.allowed then
choice.again()
endif
You said : The "EXIT" option can be disabled from the "Standard Options", in Maintain Forms, but I would like to control this from the script.
You can disable the end.program and abort.program in the script and leave the user a chance to abort without save :
question ="The number of lines is less then the numeric value punched ,quit without save ?"
choice.end.program:
before.choice:
If number.of.line.not.ok () then
message("The number of lines should be ATLEAST the numeric value punched ")
choice.again()
endif
choice.abort.program:
before.choice:
If number.of.line.not.ok () then
if (ask.enum(question,tcyesno.no)=tcyesno.yes then
delete.data.before.exit()
else
choice.again()
endif
endif
function domain tcbool number.of.line.not.ok()
{
If number of lines less then value purchase
return(true)
endif
return(false)
}
function delete.data.before.exit()
{
Here you delete the data that the user inserted.
}
Ilan S
morpheus
21st November 2002, 10:52
Ilansu,
As mentioned in the earlier posts, I was looking for some system variable or function, for this requirement. Like Zach mentioned about g.exit.menu . I could not find this variable!! Do you know something about this!?
rupertb
22nd November 2002, 11:12
Hello earth to Morph: surely the examples already posted are more than sufficient in order for you to achieve your objective! What's this obsession with a 'system variable'?
:confused: Rupert
morpheus
22nd November 2002, 12:25
:D
Don't get confused, dear Rupert!!
It is not the obsession for the system variable. It is the obsession to know maximum about BaaN!!
The logic could have been written in any language. The logic is not dependent on languages. It is the features of languages/platforms which keep on changing. And hence, the curiosity to know more features!!
Hope my curiosity is justified.
;)
morpheus
14th February 2003, 11:16
Originally posted by zacharyg
try this ...
I believe g.exit.menu is the variable you're looking for.
Can anyone give me more information on this variable!!?
rupertb
14th February 2003, 11:37
Howdee Morph:) What's keeping you from your goal? Surely the functionality programmed into the 'choice.abort.program' is sufficient for your purposes:confused:
Anyhow how about some straight shootin' here - have you coded the 'choice.abort.program' section as described above and does or doesn't it work?
Nice to hear from you again!
Rupert
morpheus
14th February 2003, 11:45
Hey Rupert,
I was expecting you to be the first one!!;)
The problem was solved long time back, infact as back as my last post. Was just going through my "To do" notes, and found this variable still mentioned there:mad: .
And, the curiosity (as mentioned in my earlier post) is still not at peace. So, help me....
:)
rupertb
14th February 2003, 12:26
Well Morph, peace be with you - I cannot offer any help on that variable :( Where is Zach by the way? Can't he shed any light on this issue - seeing that he first brought it up?
Regards,
Rupert
morpheus
14th February 2003, 12:37
Yes, may be Zach or Gurus of this forum may help me. :)
BTW enjoying ICC cup!!?;)
NPRao
14th February 2003, 19:38
Yes the World Cup Cricket is interesting and there are few upsets.
You can look up online for live commentry at -
http://www.cricinfo.com
http://www.cricket.org/ :D