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 12th May 2003, 05:56
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Unhappy text.write does not return new text number

We are using text.write function to create Sales Order texts from .txt files. After changing to poting set 6.1c.06.07 and
upgrading to SP11 text.write functions is returning existing text number instead of creating new text.

eg :

Existing text no 23456 having 1 line of text
tmp.file is a text file having 15 lines of text

Code:
t.no =  text.write( "txt.name", "2", kw1,kw2, kw3, kw4, "", "",  tmp.file )

if t.no < 0 then
	message("Error Writing Text for Order No /n %d", tdsls040.orno)
else
	commit.transaction()
	message("Writing Text for Order No /n %d", tdsls040.orno)
endif

after
Code:
t.no =  text.write( "txt.name", "2", kw1,kw2, kw3, kw4, "", "",  tmp.file )
t.no = 15 -> this is right, as expected it should return the number of line written which is 15
txt.name -> should return a new text number, instead it returns 23456, which already exists

I get the message "Writing Text for Order No ...", which means transaction is commited.
Now if you see text 23456 in Maintain Texts it shows the original text with 1 line.


As I see it text.write is not creating a new text for some reason.

Am I missing something here?, Baan support is unable to help (as usual !!).

__________________


Akshay
Reply With Quote
  #2  
Old 12th May 2003, 09:09
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,072
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
What if

Currently your call is using defaults for textgroup and textwindow (tgroup and edit_opt, see here). What if you do not depend on the user determined defaults? And your file really does contain only plain text (no "strange tss characters" Windows sometimes put into plain text files)?
__________________
Also read Luke 24:4-8
Reply With Quote
  #3  
Old 12th May 2003, 11:03
klixy23's Avatar
klixy23 klixy23 is offline
Senior Member
 
Join Date: Feb 2002
Location: Germany
Posts: 116
klixy23 is on a distinguished road
Baan: BaaN IVc4 - DB: Informix - OS: Windows Sever 2003
Quote:
t.no = text.write( "txt.name", "2", kw1,kw2, kw3, kw4, "", "", tmp.file )
Is <bic_text> included?
Is "txt.name" (the text_field argument) a "text" type database table field or an externally declared long variable?

Have a nice day!
Reply With Quote
  #4  
Old 12th May 2003, 12:21
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Hi Omeluuk and Klixy,

Thanks for your replies,

Quote:
What if you do not depend on the user determined defaults? And your file really does contain only plain text (no "strange tss characters" Windows sometimes put into plain text files)?
I have checked text group, text window, text authorisations seems to be no problem there. Text is pure DOS text no tss characters.

In fact this session was working fine till we upgraded the porting set and Service pack as mentioned before. Attaching a sample text file for your ref.
__________________


Akshay
Reply With Quote
  #5  
Old 12th May 2003, 12:37
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,072
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
Otherwise, try to debug with -- -set TT_SQL_TRACE=number and/or -- -set DBSLOG=number. Then you will be able to see what transactions are done and what records will be handled, depending on what number you will choose. See for options the settings file in this thread.
Quote:
Tracing and Logging:
--------------------------------------------------------------------------------
2.1 "-- -set TT_SQL_TRACE=value (or added values)" Logging
information from the Baan database driver. Maximum value = 0277367
-set TT_SQL_TRACE=0000001 Parse Query Strings and show information
-set TT_SQL_TRACE=0000002 Show RDD usage of Query
-set TT_SQL_TRACE=0000004 Final Dump info queries
-set TT_SQL_TRACE=0000020 Database Actions ("Operand" "Operator")
-set TT_SQL_TRACE=0000040 Show queries wih their QID
-set TT_SQL_TRACE=0000100 Mode of query
-set TT_SQL_TRACE=0000200 Show query exec. times
-set TT_SQL_TRACE=0001000 Show table dependencies (matrices)
-set TT_SQL_TRACE=0002000 Show calls of internal SQL functions
-set TT_SQL_TRACE=0004000 Show query eval. plan (client+server)
-set TT_SQL_TRACE=0010000 Show quey ev. plan (server)
-set TT_SQL_TRACE=0020000 Show all full table scans
-set TT_SQL_TRACE=0040000 Database Action Messages
-set TT_SQL_TRACE=0200000 Query Distribution Plan
-set TT_SQL_TRACE=0400000 Show current time to level of milliseconds

Note: After startup TT_SQL_TRACE can be set, raised or lowered with bshcmd:
-T "TT_SQL_TRACE=value" set to value
-T "TT_SQL_TRACE+value" add bits to current value
-T "TT_SQL_TRACE-value" remove bits from current value

2.3 "-- -set DBSLOG=value (or added values)" Logging information
from the online processing of the database driver.
-set DBSLOG=0000001 Data dictionary info of tables
-set DBSLOG=0000002 Query info (SQL level 1)
-set DBSLOG=0000004 Query info (SQL level 2)
-set DBSLOG=0000010 Row action info
-set DBSLOG=0000020 Table action info
-set DBSLOG=0000040 Transaction info
-set DBSLOG=0000100 DBMS input/output data (SQL level 2)
-set DBSLOG=0000200 Admin file info (SQL drivers)
-set DBSLOG=0000400 DBMS SQL statements
-set DBSLOG=0001000 General debug statements
-set DBSLOG=0002000 Query processing info
-set DBSLOG=0004000 Data buffering info (communication)

Note: After startup DBSLOG can be set, raised or lowered with bshcmd:
-T "DBSLOG=value" set to value
-T "DBSLOG+value" add bits to current value
-T "DBSLOG-value" remove bits from current value
__________________
Also read Luke 24:4-8
Reply With Quote
  #6  
Old 12th May 2003, 13:41
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Thanks Omeluuk, I'll try tracing...
__________________


Akshay
Reply With Quote
  #7  
Old 14th May 2003, 12:24
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Problem Solved

I was finally able to solve the problem by using a table field for text name instead of an extern long variable

Before
Code:
extern long txt.name
t.no =  text.write( "txt.name", "2", kw1,kw2, kw3, kw4, "text", "text", tmp.file )
Now
Code:
 t.no =  text.write( "tdsls040.txtb", "2", kw1,kw2, kw3, kw4, "text", "text", tmp.file )

Help says :
Quote:
The text_field, text_field_from, and text_field_to arguments must always contain a text field name. This name can be the name of a database field of type DB.TEXT, or it can be the name of a variable of type long. In both cases, the name must be enclosed by quote marks. When using a variable, this must be declared as EXTERN because the functions use the text_field argument indirectly to store the text number of the specified text. Database text field names are automatically declared as external.
Looks like only table field can be used ...


Thanks everyone for your help
__________________


Akshay
Reply With Quote
  #8  
Old 14th May 2003, 12:32
OmeLuuk's Avatar
OmeLuuk OmeLuuk is offline
Guru
 
Join Date: Mar 2002
Location: The Netherlands
Posts: 1,072
OmeLuuk is on a distinguished road
Baan: Infor LN 6.1 10.2.1 - DB: MS SQL2008 - OS: VM WindowsServer2008R2
What was your declaration of txt.name?
Quote:
When using a variable, this must be declared as EXTERN because the functions use the text_field argument indirectly to store the text number of the specified text.
Should have been: "extern long txt.name"
__________________
Also read Luke 24:4-8
Reply With Quote
  #9  
Old 14th May 2003, 14:40
zardoz's Avatar
zardoz zardoz is offline
Guru
 
Join Date: Jan 2003
Location: Torino, Italy
Posts: 445
zardoz is on a distinguished road
Baan: Triton 2, Triton 3, Baan IV, Baan ERP, Baan LN - DB: Oracle, Tbase, MS Sql - OS: Unix, Windows
I have just encountered this problem.
There is a bug or undocumented feature in this function....

If the field name is a database field, the text is created in your own company, but if the field name is an external var the text is created in the company 0!
Reply With Quote
  #10  
Old 15th May 2003, 05:05
ahulikavi's Avatar
ahulikavi ahulikavi is offline
Member
 
Join Date: Jan 2002
Location: Pune, India
Posts: 81
ahulikavi is on a distinguished road
Baan: BaaN IVc4 - DB: Oracle 8.x, mySQL - OS: Sun Solaris 2.6, RH 7.2
Thumbs up Thanks Zardoz !

You are right, texts were getting created, but in company 000. Omeluuk declaration was extern, anyways thanks to Zardoz this "feature" has now been documented !!! (atleast on Baanboard)
__________________


Akshay
Reply With Quote
Sponsored Links
  #11  
Old 4th September 2017, 11:03
alex.bonutti alex.bonutti is offline
Junior Member
 
Join Date: May 2017
Posts: 11
alex.bonutti is on a distinguished road
Baan: 10.3 - DB: MSSQL - OS: Windows 10
Hi all,
I'm developing a session extension with Tools 10.5 which should create and save a predefined text in purchase order footer. I've tried both via external variable or via database text field, text is created but I'm not able to commit the transaction and save it. I'm using DAL

ret = dal.change.object("tdpur400")
ret = dal.save.object("tdpur400")

or

ret = dal.change.object("tdpur400")
dal.set.field("tdpur400.txtb", text_nr)
ret = dal.save.object("tdpur400")

or even db update funtions

db.update(ttdpur400, db.retry)

but transaction cannot be completed with DAL error

Record ... cannot be saved in table Purchase Orders in company ...

If I commit just the text.write function, a text is correctly saved in the database, but it can't be linked to my entity (which is a purchase order). Can someone help me?

Thanks,
Alex
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
Text Number from Text Manager mark_h Tools Development 10 17th January 2014 19:21
printing different languages on one layout olabas Tools Development 8 21st May 2002 14:27
CODE: VB Calling a DLL gfasbender Code & Utilities 0 13th March 2002 16:42


All times are GMT +2. The time now is 21:53.


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