Jordi.Tolra
2nd April 2014, 15:08
Hello,

I'm trying to avoid the question that pops up when creating a text, tttxt.tm01:
"No text present; create, Duplicate, Select or Exit?"

I would like that my program choose automatically the option Create, without do the question.

Does anybody know if it is possible? How can it be done?

thanks

Jordi

mark_h
2nd April 2014, 16:30
Not sure if this would work but in the choice.text.manager section in the before.choice event see if you can set up empty text using something like text.write. That might prevent the session from asking the question.

mark_h
2nd April 2014, 16:43
Just briefly test this in a session, but it seemed to work:


choice.text.manager:
before.choice:
| Set the key words for the text.
set_text_attrs()
string kw1(17),kw2(17),kw3(17),kw4(17),tgrp(8),eopt(15)
long write.return, ret.code
db.retry.point()
db.eq(ttppss990,db.delayed.lock)
write.return = text.write("tppss990.txtn", "2", attr.textkw1$, attr.textkw2$, attr.textkw2$, kw4, "purchase", "", "/baan/emptytext")
db.update(ttppss990,db.retry)
commit.transaction()


I did not get the question, but I did not test a whole log.

bhushanchanda
2nd April 2014, 17:23
Hi,

I am doubtful. I guess this is about handling the standard message when you intend to create a new text for a specific record.

The text manager checks whether there is any text present for the current record or not. If not, it pops up the message. Hence, to handle this, you may need to update a temporary text like some blank character in the table tttxt010 in before.choice and check whether it works.

Just a thought. You might also want to try Marks method.

Jordi.Tolra
2nd April 2014, 17:44
Hello,

I was already thinking in do something like what Mark proposes.
I tried it and it worked.

Many thanks

Jordi