Retirement Notice
|
|
User login
|
|
Frontpage Sponsor
|
|
Poll
|
What do you expect from your SI Implementation partner for the success of ERP implementation. Bring best practices - Not to offer more CR's Leveraging standard functions 20% Need more honesty to work with the Users until their processes are fully mapped & Users are trained 40% Focus on process automation/ integrations/ Real time data/ BI analytics 13% Stick to basics 27% Total votes: 15 |
|
|
 |

16th March 2010, 15:18
|
Guru
|
|
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
|
|
Baan: B50B -
DB: Oracle 8.0 -
OS: Win2k AS
|
Copy text between companies
Baan: Other/Unknown C/S: None/Unknown
Hey all,
I am writing a session to dynamically copy texts from one company to another based on tables in a file and/or form selection.
I have come across a function text.copy.between.companies() in the help file (see below). I tried to use it, but no results. I always get return value 0, and no text is created nor updated.
Quote:
long text.copy.between.companies( string text_field_to(17), string text_field_from(17), long source_company, long target_company, string kw1(17), string kw2(17), string kw3(17), string kw4(17), string tgroup(8), string edit_opt(15) )
Description
This copies the entire text of a specified text field, for all languages, from one company to another.
Arguments
text_field_to The name of the new text field. See Text fields: overview. This returns the text number for the new text field.
text_field_from The name of the text field that must be copied. See Text fields: overview.
source_company This specifies the source company.
target_company This specifies the destination company.
kw1 to kw4 Use these arguments to specify key words for the new text. If you specify one or more of these arguments as an empty string, the corresponding key word(s) are copied from the original text. It is possible, for example, to specify two new key words and to copy the other two from the original text.
tgroup This specifies the name of the text group to which the new text must be assigned. If you specify an empty string here, the text is assigned to the user"s default group.
edit_opt This specifies the type of window in which the text must be displayed.
Return values
>0 success; returns the number of lines copied
-1 error
|
I have tried with and without commit.transaction(), with or without selection for update, no results.
Does anybody know this function and can tell me if it works and how to use it?
Thanks in advance!
Regards,
Eli Nager
|

16th March 2010, 16:23
|
 |
Guru
|
|
Join Date: Apr 2002
Posts: 1,982
|
|
Baan: 2.2/3.1/4c4/LN6.1 FP6/FP9/HiDox Tools 10.7/D.3 -
DB: tbase, ms-sql7, oracle10gV1, 11g, 12c, 19c -
OS: HP-UX, W2K3, SLES, RHLE
|
#include <bic_text>
Quote:
Originally Posted by en@frrom
Hey all,
I am writing a session to dynamically copy texts from one company to another based on tables in a file and/or form selection.
I have come across a function text.copy.between.companies() in the help file (see below). I tried to use it, but no results. I always get return value 0, and no text is created nor updated.
I have tried with and without commit.transaction(), with or without selection for update, no results.
Does anybody know this function and can tell me if it works and how to use it?
Thanks in advance!
Regards,
Eli Nager
|
Hello eli,
found this hint on BaaNboard :
#include <bic_text>
Regards
__________________
//Bernd
|

16th March 2010, 16:32
|
Guru
|
|
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
|
|
Baan: B50B -
DB: Oracle 8.0 -
OS: Win2k AS
|
Bernd,
Thanks for your reply. Obviously I included the bic_text, otherwise my script wouldn't even compile.
I already got it working meanwhile. I had entered as the first two arguments for the function (new text and orig.text) the text fields, but it had to be the text numbers. Also a db.update of the update table is necessary followed by a commit.transaction(). The commit is also for the tttxt tables. Those will not be updated with the new text number until a commit.
Regards,
Eli
|

16th March 2010, 17:43
|
Guru
|
|
Join Date: Jan 2002
Location: Ehingen, Germany
Posts: 649
|
|
Baan: Baan IVc4, Infor LN 10.6 -
DB: Informix, MS-SQL -
OS: HP-UX, Windows
|
Here is my working example (some archiving to a company 999):
Code:
function test()
{
long old.txta
db.retry.point()
select tdsls040.*
from tdsls040
as set with 1 rows
selectdo
| SAVE ORIGINAL TEXT NUMBER!
old.txta = tdsls040.txta
tdsls040.txta = 0
tdsls040.txtb = 0
tdsls040._compnr = 999
db.insert(ttdsls040, db.retry+db.skip.dupl)
endselect
commit.transaction()
long rc
string tgroup(8)
string edit_opt(15)
rc = text.defaults("tdsls040.txta", tgroup, edit_opt)
db.retry.point()
select tdsls040.*
from tdsls040 for update
where tdsls040._index1 = {:tdsls040.orno}
and tdsls040._compnr = 999
selectdo
| set tdsls40.txt to the original text number
tdsls040.txta = old.txta
rc = text.copy.between.companies("tdsls040.txta", "tdsls040.txta",
get.compnr(), 999, "kw1", "kw2", "kw3", "kw4", tgroup, edit_opt)
| now the text is copied, and tdsls040.txt has the new value
db.update(ttdsls040, db.retry)
endselect
commit.transaction()
}
Günther
|

17th August 2010, 01:30
|
Junior Member
|
|
Join Date: Jul 2009
Location: Jakarta, Indonesia
Posts: 16
|
|
Baan: BaaN IV c4, ERP LN 10.3, LN 10.4 -
DB: Informix, Oracle, MS-SQL 2008 -
OS: Windows and Unix
|
Thanks
Hey thanks a lot ... your solution solved my problem.
Shashi 
|

17th August 2010, 05:09
|
Senior Member
|
|
Join Date: Oct 2005
Location: Northeast Ohio
Posts: 199
|
|
Baan: Baan 4c4, 5C, LN -
DB: Informix, Oracle, SQL -
OS: HP UX, Win2K
|
Quote:
Originally Posted by en@frrom
Bernd,
Thanks for your reply. Obviously I included the bic_text, otherwise my script wouldn't even compile.
I already got it working meanwhile. I had entered as the first two arguments for the function (new text and orig.text) the text fields, but it had to be the text numbers. Also a db.update of the update table is necessary followed by a commit.transaction(). The commit is also for the tttxt tables. Those will not be updated with the new text number until a commit.
Regards,
Eli
|
The 'text_field_from' and 'text_field_to' fields are strings that contain the name of the fields involved in the copy. One or both may be the name of a table field (extern by default) and/or the name of a local long variable that must be declared as extern. Failure to use extern long variables when other than table fields will result in the returned text number as zero.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|