Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 8th August 2017, 12:38
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 567
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Wink Maintaining text (other then main table)
Baan: Baan IVc4
C/S: Both

Hello Everyone,

this is related to Baan IV

I have a multi-occurance maintenance (tiitm9109m003) session for new custom table (tiitm909). The table has only three fields but no text field.

I want to maintain text of another table tiitm001.txtu (it's a custom text field).
I have added the text field of tiitm001.txtu through Text Field option in Specific menu. Now clicking on text button, the text manager opens, but when I save and exit text manager, the text is not saved in the tiitm001.txtu. The value of tiitm001.txtu still remains 0 (zero).

Has anybody faced similar issue ? I would appreciate any help in this regard.

Vishal
Reply With Quote
  #2  
Old 8th August 2017, 14:35
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
The one time I did something like this was to use qkey to change a baan standard session. So on program tppss9161m00b I maintain text tppss990.txtn. So like you I added it to the maintain texts. Then when you create text it returns to the after.rewrite of maintable.io - at that point I go update the tppss990 table with the text number. Simple little select update statement to update the text number and a few other fields.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #3  
Old 8th August 2017, 14:56
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 567
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Red face

Hello Mark,

Thanks for update. But in my case, the session where I need to invoke the text manager is new developed one. And the table it maintains the data does not contain any text field. It goes like below:

table structure of tiitm909:
Item tcitem
tcru tcmcs.str3
tdef tcmcs.str3

The text field to be maintained is tiitm001.txtu[/b]. But it has to be maintained through tiitm9109m003 and not through tiitm0101m000.

The session to maintain data in table tiitm909 is tiitm9109m003 (multi-occurrence). In session tiitm9109m003, I am able to add text field tiitm001.txtu through specific menu. On clicking text icon, It successfully invokes the text manager, but on saving, it does not store the text number in tiitm001.txtu.

So, in above case, I do not think I would be required to use QKey as the session script of tiitm9109m003 is available with source code, the only problem is adding text to tiitm001.txtu through session tiitm9109m003.

I am still searching Baanboard to find a thread with similar scenario.

Thank you again,
Vishal
Reply With Quote
Sponsored Links
  #4  
Old 8th August 2017, 17:39
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Sorry was not clear on what I meant. What I am saying is that if you put something in the main.table.io after.rewrite section to go do a select/update on tiitm001.txt then it might solve your issue. In my case I was updating a standard baan session to maintain a text field on a completely different table. Basically same thing you are doing.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #5  
Old 8th August 2017, 18:26
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 567
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hi Mark,

I think there is some misunderstanding. I want to update the text from other session which is based on a table (tiitm909) which is not having any text field. One simple way is to add text field in tiitm909 and then follow the steps you have suggested. But, I do not want to add any text field in tiitm909.

Regards,
Vishal
Reply With Quote
  #6  
Old 8th August 2017, 19:33
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
That is what I am saying - add text field tiitm001.txtu to your session on the text fields which I think you aready did. Then go into your session script - in the main.table.io section after.rewrite - put in a message statement message(tiitm001.txtu). Compile your session - run it and create text for an item. When you exit the text it should give you the text number. If that works then just add code to go update the tiitm001 table for that item using that that text number for the item you just added text to. Some where alone the way you are going to have to update tiitm001 with the text number.
example:
Code:
main.table.io:
after.rewrite:
  select tiitm001.txtu
  from tiitm001 for update
  where tiitm001.item = :your-item probably tiitm909.item
  selectdo
      tiitm001.txtu = tiitm001.txtu
  endselect
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #7  
Old 9th August 2017, 13:40
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 567
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hello Mark,

Unfortunately, the text number returned is zero. I am able to achieve updating text number through below code, but the issue is the text editor opens twice. I mean when first time it opens the text editor, I just enter the text and close it, but it opens one more time.

text.num = text.edit("tiitm001.txtu", "2", "tiitm001.txtu", tiitm001.seak, "", tiitm001.item, "text", "", 3)

select tiitm001.item, tiitm001.txtu
from tiitm001 for update
where tiitm001._index1 = {:tiitm909.item}
selectdo
tiitm001.txtu = text.num
db.update(ttiitm001, db.retry)
commit.transaction()
endselect

I suspect it is because I have added the text field tiitm001.txtu in Text Fields in specific menu. Any clue how to close the text editor process ?

Thank you for your help.

Vishal
Reply With Quote
  #8  
Old 9th August 2017, 14:55
VishalMistry's Avatar
VishalMistry VishalMistry is offline
Guru
 
Join Date: Dec 2004
Location: India, Gujarat
Posts: 567
VishalMistry has a little shameless behaviour in the past
Baan: Baan IV, ERPLn - DB: SQL Server 2000 / 2008 - OS: Windows Server 2003 / 2008
Hello Mark,

Finally I was able to do it. Below is the code that worked for me:

select tiitm001.item,tiitm001.seak, tiitm001.txtu
from tiitm001
where tiitm001._index1 = {:tiitm909.item}
selectdo
endselect

on case attr.textfield$
case "tiitm001.txtu":
text.num = text.edit("tiitm001.txtu", "2", "tiitm001.txtu", tiitm001.seak, "", tiitm001.item, "text", "", 3)

select tiitm001.item, tiitm001.txtu
from tiitm001 for update
where tiitm001._index1 = {:tiitm909.item}
selectdo
tiitm001.txtu = text.num
db.update(ttiitm001, db.retry)
commit.transaction()
endselect

endcase
|Below line is important as it will suppress opening up the text manager again
attr.textfield$ = ""
choice.again()
Reply With Quote
  #9  
Old 9th August 2017, 17:08
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Thanks for posting the solution. Might help others in the future. I totally forgot the first part from my session where I look up the text number on the table. I do that in the main.table.io after read section and I set the text attributes in the text.manager before choice event.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editable additional field? alex.bonutti Tools Development 1 22nd May 2017 13:04
Sessions without main table iiparrag Tools Development 3 19th February 2010 07:30
Tables used for MRP and PRP. BurghMan Tools Development 1 10th February 2005 14:08
CODE: Table Loader ~Vamsi Code & Utilities 3 26th February 2003 13:05


All times are GMT +2. The time now is 14:07.


©2001-2017 - Baanboard.com - Baanforums.com