mark_h
18th January 2002, 23:29
I am modifying a maintain session to allow text. I have created another table to hold the text number, modified the session to activate the text.manager(this works). The only thing I can not figure out is how to get the text number created to update my new table. Also I am assuming I will need this text number to edit the text previously completed. I have searched through knowledge quest and some old Baan Fans digests and have not found anything to show me how to do this. Can someone post an example or a clue?
By the way, I am not allowed to modify the maintain able on the session - which would work. So I am using qkey to modify the session and to update the new table, just need that pesky old text number.
TIA!
Mark
shah_bs
19th January 2002, 18:43
Hello Mark.
I am not familiar with QKEY, so my suggestion is based on what I would do based on the design condition you have mentioned. You can adapt it suitably:
Assumptions:
- Primary Keys of the original table and your new table are identical.
Suggestion:
- Generate a new (sub)session with your new table as the main table.
- Modify the original session to call this sub-session by ensuring that the primary key is passed on (instead of calling the text manager as you have done).
- In your new session, ensure that a record is created if it is missing, or fetched if it exists.
- Then fire up the text manager in your new session. (Or you may let the user hit the <T>ext button if it is acceptable - that way you avoid the unnecessary programming to automatically call the text manager).
The text number updating then becomes the responsibility of the new session (it will automatically update on save) and you will not have to take any special actions to update the number in your new table.
Let me know if this helps.
evesely
21st January 2002, 17:55
I haven't tried this and I don't know QKEY (but this would be possible using ~Vamsi's rush utility), but here's a thought:
Make a before.choice subsection for the choice.text.manager section. In this subsection, call text.edit yourself using the value of the text field from the new table or some other dummy field (it will have a 0 value if there is no existing text). After the text.edit call, your field should contain the text number. Then, update your table. Call choice.again() or do whatever you need to do to make sure the "real" text manager call doesn't fire.
~Vamsi
21st January 2002, 21:45
Been a long time since I tried any of this stuff. For many sections does using "on.choice" force the standard program's events not to be called?
If that is the case, just use Qkey and program in on.choice using the logic mentioned by Ed.
mark_h
22nd January 2002, 15:12
Thanks. I will give Ed's suggestion a try. If that does not work then I will try what shah_bs suggested.
Mark
mark_h
22nd January 2002, 21:31
Just thought I would let everyone know how I solved the problem. It appears that the text field I assigned to the session is filled when returning from text manager. So in the after.choice section I went and updated my table. I also added txta.yn field that contains yes if text exists in my table. In this before.display section I retrieve the text number if it exists.
Thanks for the suggestions.
Mark
mig28mx
30th September 2008, 17:29
Hello Mark.
I´m facing the same problem on a development.
Can you share your code?
I also added a after.choice on choice.text.manager option and write
db.update(mytexttable) but appears an error 112 when i executed.
Any clue?
Thank you in advance.
mark_h
30th September 2008, 17:57
See attached sample script. It is a qkey version used to update the text field on a new table that was created.
abattoir
17th January 2014, 00:23
Hi,
I have a update session, where I want the user to edit (if already existing) or create new text before hitting "Update" button.
I have no problem in having the user to create new text, but how do I ensure that the user is actually editing the text before hitting the "update" button. The user could simply open and close the text editor (w/o actually editing any text). Which function or predefined variable tracks this?
I am using text.edit() , but it is not helping in the case when text exists and want to track if it has changed or not.
Thanks,
Abattoir
bhushanchanda
17th January 2014, 06:45
Hi,
In choice.text.manager: section, you can check in text values in before.choice and after.choice using text.to.buf() function or you can use main.table.io: section with before.rewrite: subsection.
abattoir
17th January 2014, 20:21
Hi Bhushan,
Thanks for the suggestion, I will use that.
Regards,
Abattoir