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 27th January 2017, 04:01
showstuff11 showstuff11 is offline
Junior Member
 
Join Date: Mar 2015
Posts: 22
showstuff11 is on a distinguished road
Baan: fp3 - DB: sql server 2008 r2 - OS: windows 7
How to use text.write() function
Baan: Other/Unknown
C/S: None/Unknown

Good morning,

can i call for a help on how to use this text.write function,
i cannot really understand on how to use this code..
ths is from another post here in baanboard
http://www.baanboard.com/baanboard/s...ead.php?t=9968

t.no = text.write( "tdsls040.txtb", "2", kw1,kw2, kw3, kw4, "text", "text", tmp.file )

this is the condition im facing... a header remarks with 2 to more line of text

please help me understand this function..
Reply With Quote
Sponsored Links
  #2  
Old 27th January 2017, 07:58
bdittmar's Avatar
bdittmar bdittmar is offline
Guru
 
Join Date: Apr 2002
Location: Germany, 50.584097,8.544078
Posts: 1,639
bdittmar will become famous soon enough
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox - DB: tbase, ms-sql7, oracle10gV1, 11g - OS: HP-UX, W2K3, SLES
text.write()

Hello,
Code:
text.write()
Syntax:

function long  text.write  (string text_field, string lang, string kw1, string kw2, string kw3, string kw4, string tgroup, string edit_opt, string tmp_file [, long bidi] [, string rtf_file])

Description


This adds a new text to the text manager and assigns a new text number to the text.


Arguments

string text_field The name of the new text field. See Text fields overview. This returns the text number for the new field.
 
string lang This specifies the language for the new text.
 
string kw1 Use these arguments to specify key words for the text.
 
string kw2  
string kw3  
string kw4  
string tgroup This specifies the name of the text group to which the text must be assigned. If you specify an empty string here, the text is assigned to the user's default group.
 
string edit_opt This specifies the type of window in which the text must be displayed.
 
string tmp_file The name of the file where the text for the new field is stored. The contents of this file is changed before the text is stored, Long lines are wrapped to meet the line width of the text group to which the text is assigned.
 
[long bidi ] Use this optional argument to indicate the text alignment. Possible values are:

true      text is right justified

false    text is left justified; this is the default option
 
[string rtf_file ] The name of the file in which the RTF version of the text must be stored. This is an optional argument. The usage of this argument depends on the settings of the text group as defined in the tgroup argument. If this is an empty string, no text is retrieved and the function returns 0.
 
 
Return values

>0        success; returns the number of lines written

 <0        error
Include bic_text :
Code:
#include <bic_text>
             

void
             remove.textfields() ( const string field.name.string, ... ) 

void
             set.file.for.textfield() ( const string field.name.string, const string filename ) 

long
             text.copy() ( string text_field_to(17),   string text_field_from(17),   string kw1(17) mb, string kw2(17) mb,  string kw3(17) mb, string kw4(17) mb,  string tgroup(8), string edit_opt(15) ) 

long
             text.copy.between.companies() ( string text_field_to(17),   string text_field_from(17),   long source_company,   long target_company, string kw1(17) mb,  string kw2(17) mb, string kw3(17) mb,   string kw4(17) mb, string tgroup(8),  string edit_opt(15) ) 

long
             text.copy.language() ( long textnr, string lang_from,   string lang_to ) 

long
             text.defaults() ( string text_field(17),   ref string tgroup(8),   ref string edit_opt(15),  [long comp_number] ) 

long
             text.delete() ( string text_field(17), string lang ) 

long
             text.edit() ( string text_field(17), string lang, string kw1(17) mb, string kw2(17) mb, string kw3(17) mb, string kw4(17) mb, string tgroup(8), string edit_opt(15),   long mode ) 

long
             text.present.in.language() ( long textnr, string lang   [, ref long nr_lines ] ) 

long
             text.read() ( string text_field(17), string lang,   ref string kw1(17) mb,   ref string kw2(17) mb,   ref string kw3(17) mb,   ref string kw4(17) mb,   ref string tgroup(8),   ref string edit_opt(15),   string tmp_file(256), long lock [,string rtf_file(256)] ) 

long
             text.rewrite() ( string text_field(17), string lang,   string kw1(17) mb, string kw2(17) mb, string kw3(17) mb, string kw4(17) mb, string tgroup(8), string edit_opt(15),   string tmp_file(256) [, long bidi, string rtf_file(256)] ) 

long
             text.to.buf() ( string text_field(17), string lang,   long nr_lines,  ref string buf(,)   [, long rtf.text] ) 

boolean
             text.buf.to.field() ( string text_field(17), string buf ) 

boolean
             text.set.keywords() ( string text_field(17), string kw1(17),   [, string kw2(17),  string kw3(17),   , long kw4(17)] ) 

boolean
             text.set.language() ( string text_field(17), string language(1)) 

long
             textfield.to.database() ( string text_field(17) ) 

long
             textfield.to.buf() ( string text_field(17), ref string buffer ) 

long
             text.window() ( string edit_opt(15),   ref long start_column,   ref long start_row,   ref long number_columns,   ref long number_rows ) 

long
             text.write() ( string text_field(17), string lang, string kw1(17) mb, string kw2(17) mb, string kw3(17) mb, string kw4(17) mb,  string tgroup(8), string edit_opt(15),  string tmp_file(256) [, long bidi, string rtf_file(256)] )
Regards
__________________
//Bernd
Reply With Quote
  #3  
Old 4th September 2017, 11:12
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. This is a sample of my 4GL code:

...
file.tmp = creat.tmp.file$()
ft = seq.open(file.tmp,"w")

text_body = "Sample text"
ret = seq.puts(text_body, ft)
seq.close(ft)

ret = text.write("tdpur400.txtb", "6", "Purchase.", "Order footer.", tdpur400.orno, "", "text", "text", file.tmp)

ret = dal.change.object("tdpur400")
ret = dal.save.object("tdpur400")
if ret <> 0 then
abort.transaction()
ret = dal.get.error.message(error.mess)
message(str$(ret) & " - " & error.mess)
else
commit.transaction()
message("Footer text created for purchase order " & tdpur400.orno)
endif
...

dal.get.error.message return value is 1.
I made a few tries with DAL scripts

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 in 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
Error while opening opening purchase order naga ch Tools Administration & Installation 6 17th June 2016 22:42
How to call AFS in sp24? PV Ramone AFS/DDC/OLE: Function servers 4 2nd September 2008 11:06
Compile error,help! gavin_wusj Tools Development 5 5th April 2005 09:09
xml question steveauckly Tools Development 4 27th July 2004 10:41


All times are GMT +2. The time now is 02:03.


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