pralash
16th October 2017, 12:30
Hi,
I'm new to LN...
I want to know that how to display the Message Dialogue box in baan like in visual basic...
If I click the "yes" button some action would be happened and click the "No" button some another action would be executed...
Can you please assist me how to develop this task with a sample script...
Thanks in advance,
Regards,
Pralash
bhushanchanda
16th October 2017, 13:12
Hi,
You can use ask.enum() function to do it.
Syntax:
function bset ask.enum (string quescode, bset default_enumval [, void arg, ...])
Description
This displays a message box containing a question and a number of possible responses. The responses are presented as push buttons. To respond to the question and close the message box, the user selects one of the push buttons.
The possible responses are defined in the data dictionary as an enumerated domain. By default, the function displays all of the defined enumerate values. To display a subset only, call set.ask.enum.values() before calling ask.enum().
Arguments
string quescode The question to be displayed in the message box is defined in the data dictionary. This argument specifies the data dictionary code for the question.
If the question contains substitution symbols, use the third and subsequent arguments to specify the values to substitute for these symbols.
bset default_enumval Specifies the enumerate value of the default answer. For example, tcyesno.yes. If this argument is empty, the default value specified in the data dictionary is used.
[void arg, ...] The values to substitute for any substitution symbols that the question contains. See sprintf$().
Return values
The value of the enumerated domain that corresponds to the option selected by the user. This is always the enumerate value and not its description.
e.g. Create a question code with the text/question you need. In this case, its tccom00001
if ( ask.enum( "tccom00001", tcyesno.yes, ret, filename ) = tcyesno.no) then
|# Do this if user clicks on No
else
|# Do this if user clicks on Yes
endif
bdittmar
16th October 2017, 13:13
Hello,
ask.enum()
Syntax:
function domain ask.enum (string quescode, domain default_enumval [, string arg, …])
Description
This displays a message box containing a question and a number of possible responses. The responses are presented as push buttons. To respond to the question and close the message box, the user selects one of the push buttons.
The possible responses are defined in the data dictionary as an enumerated domain. By default, the function displays all of the defined enumerate values. To display a subset only, call set.ask.enum.values() before calling ask.enum().
Arguments
string quescode The question to be displayed in the message box is defined in the data dictionary. This argument specifies the data dictionary code for the question.
If the question contains substitution symbols, use the third and subsequent arguments to specify the values to substitute for these symbols.
domain default_enumval Specifies the enumerate value of the default answer. For example, tcyesno.yes. If this argument is empty, the default value specified in the data dictionary is used.
[string arg, … ] The values to substitute for any substitution symbols that the question contains. See sprintf$().
Return values
The value of the enumerated domain that corresponds to the option selected by the user. This is always the enumerate value and not its description.
Context
This function can be used in all script types.
Regards
pralash
16th October 2017, 15:19
Thanks a lot for your reply...
But I got a fatal error while executing the session...
Here I attach the screen shot. Can you please assist me how clear the bug...
Thanks in advance,
Regards,
Pralash
bdittmar
16th October 2017, 15:25
Hello,
you maintained a message, do this in questions !
ttadv4561m000
Regards
pralash
16th October 2017, 15:25
Thanks for your information...
I created a new message code tccom0200... while using this message code, it will hit a fatal error...
In my previous post, I missed the script...
Here I have mentioned script as follows...
if ( ask.enum( "tccom0200", tcyesno.yes, ret) = tcyesno.yes) then
message("yes")
else
message("no")
endif
Besides, I have attached the screen shot of message code creation...
Can you please tell me that how clear the fatal error...
Regards,
Pralash
bhushanchanda
16th October 2017, 15:32
You need to use code as -
if ( ask.enum( "tctccom0200", tcyesno.yes, ret) = tcyesno.yes) then
message("yes")
else
message("no")
tc is the package and then code is tccom0200 or you can correct the code and use com0200 in the code part.
Also, maintain Questions as Bernd said. Use session ttadv4561m000 to create new question.
pralash
19th October 2017, 09:01
Thanks a lot....
It's working fine to me...
Regards,
Pralash