bumbaermail
23rd September 2010, 17:48
Hello Team,

I am writing the following code.

stpapi.put.field("tdpur1102s000", "tdpur101.orno", curr.orno)
stpapi.put.field("tdpur1102s000", "tdpur101.pono", str$(curr.pono))
stpapi.put.field("tdpur1102s000", "tdpur101.item", whina310.item)
stpapi.put.field("tdpur1102s000", "tdpur101.qoor", str$(whina310.oqan))
stpapi.put.field("tdpur1102s000", "tdpur101.cuqp", whina310.orun)
stpapi.put.field("tdpur1102s000", "tdpur101.ddat", str$(whina310.dldt))
stpapi.insert("tdpur1102s000", true, emsg)
if isspace(emsg) then
stpapi.end.session("tdpur1102s000")
return

but it is opening the text editior for the session "tdpur1102s000" with "emsg" conatins "No Text Present? Create, Duplicate, Select, Exit" (Question Code tttxt.tm01). I have checked and found that at the point "stpapi.insert" that text editor is getting opened. I have also executed the session "tdpur1102m000" manually, but it is saving data without opening text editor.

My question is

1. How to avoid Text Editor is getting opened
2. Why text editor is getting opened

Thanks in advance
Saikat

Can you please tell how to bypass

rberti
24th September 2010, 16:12
Hi mate,

Answering to your first question: You can use stpapi.enum.answer() function to choose "Exit" option and go on with input.

Here goes the syntax:


void stpapi.enum.answer(string session, string question, bset answer)
ARGUMENTS
session: Name of the session this command is executed on.
question: Baan question code. This question code must be valid within the session i.e. the session must ask this question when the user interface is used.
answer: The enum or set answer to be supplied as answer to the question. This has to be expressed as the enum value as opposed to the numeric equivalent e.g. tcyesno.yes i.s.o. 1.

Hope it helps!

Rafael

mark_h
24th September 2010, 16:16
Rafael is correct. Try answering the question before it gets activated. As to why it opens it is hard to say - do you own source code? If so you could probably debug it to find out why it is happening. Running sessions like this can be challenging at times because of the way baan does things in the source code.