halvorn
27th September 2002, 09:44
Hi,
When looking in session tdadv4522s000 (Display Table Fields),
each field has a label description. The label description is taken from ttadv140.desc.

I'm using this SQL (in MS access) to get the label:

Select T$DESC As Description From TTTADV140000 WHERE T$CLAB='tccom010.ackx ' AND T$CPAC='tc' AND T$VERS='B40 ' AND T$CUST=' ' AND T$CLAN='2' AND T$LHGT = 1 AND T$EXPI = 2 AND T$LENG=(SELECT MAX(T$LENG) FROM TTTADV140000 b WHERE b.T$CLAB=TTTADV140000.T$CLAB)

Since there is several labels with different lengths, I didn’t come up with a better solution than selecting the one that is widest.

But this is not always correct. Has anyone the correct solution?

:rolleyes:

Markus Schmitz
27th September 2002, 12:18
Hi halvorn,

the situation is actually a bit more complicated.

1) In "Maintain fields" the developer can specify a related label.
In this case this label is used.

2) If no related label is specified, then Baan is looking for a label with the name of the field, ie. tccom010.cuno

3) part of the key o fthe labels tables is the length and the VRC.
So to take the longest label is fine. additionally you have to
start searching in the VRC tree beginning from the leaf up to the root! This is complicated as each Package can have a different tree.

Not easily done!
We are working right now ourself on writing something like a Baan database driver, which will handle this issue correctly. But this might take some time.



Enjoy

Markus

NPRao
27th September 2002, 18:53
Its a complex logic and one more attribute is the height of the label has to be considered.

And also with the BaaN-ERP series you have a new field in the index called the - Context of the label.

halvorn,

1. Can you please specify why do you like to reinvent the wheel again?

2. you might check up the functions -


long getlabel( domain ttaad.clan clan.i,
domain ttadv.cpac cpac.i, domain ttadv.clab clab.i,
ref domain ttadv.llen leng.io, ref domain ttadv.lhgt lhgt.io,
ref domain ttadv.vers vers.io, ref domain ttadv.rele rele.io,
ref domain ttadv.cust cust.io, [ domain ttadv.cont context ],
[ ref domain ttcdes desc mb ] )
from the tools dll - ttdlllabels

(or)


domain ttadv.clab iadv0037.search.label(
domain ttaad.clan clan.p, domain ttadv.cpac cpac.p,
domain ttadv.clab clab.p fixed, ref long leng.p,
ref long lhgt.p, domain ttadv.vers vers.p,
domain ttadv.rele rele.p, domain ttadv.cust cust.p,
ref domain ttcdes desc.p mb,
long search.by.relation, [ long dynamic ],
[ domain ttadv.cont cont.p ] )
from the tools dll - ttdllfindlabel

halvorn
30th September 2002, 17:37
Hi,
I love to reinvent the wheel again, or to make Baan IV a windows program for users with a simple need to view some data unfortunately for them, located in Baan.

I'm building a Baan query builder with VB.
I have imported all tools tables that I need to Access tables, that is tables that I need to show tables (and what they are called), their fields and what they are called, related tables, combined fields and enums.

After the query is built, the query can be executed from the VB program, also letting the user specify extra "search/filter" expressions. The data is fetched from Baan using ODBC. It is also possible to join the queries with "not Baan" tables.
The data is presented in a list view, and can be sorted by clicking column headers and can be easily copied to excel etc.

Using the longest label if the field has an empty clab seems to give a satisfying description. But if you can tell me how to do it correct by using sql, I'll be happy. I will not call a Baan function because I'm getting the "tools" information from Access tables which is fast.

jaapzwaan
1st October 2002, 12:45
Halvorn,

The key to all VRC searches is the usage of table ttadv112. This table contains the runtime information of the VRC path:
For every package combination/package, it shows the VRC in consequetive order. (key = pacComb/pack/seq).

For example to find a session in the current package combination with package = cpac, module = cmod and the code itself (without the package/module) = cses:


select ttadv112.*, ttadv200.*
from ttadv112, ttadv200
where ttadv112._index1 = {:curr.pacc$, :cpac} and
ttadv200._index1 = {:cpac, :cmod, :cses, ttadv112.vers,
ttadv112.rele, ttadv112.cust}
order by ttadv112._index1
as set with 1 rows
selectdo
.....
endselect


This will find the most recent vrc of the session (hence the "as set with 1 rows") because ttadv112 is sorted with the highest VRC first.

This procedure is not restricted to sessions; it also works for forms, questions, and any other software component that has a VRC.

Regards,
Jaap Zwaan

NPRao
1st October 2002, 19:35
Vamsi,

You can query the ttscm100 for the SCM components.

jaapzwaan,

The search algorithms, use ttadv111 or ttadv113 table. If it uses ttadv112, a developer having all package VRC authorizations, the search functionality will fail. This is to support Multi-package VRC authorizations and parallel development scenarios.

NPRao
2nd October 2002, 02:51
halvorn,

I found more info from my notes.


Copy to clipboard option
As a part of the standard Baan architecture, there is an option under the Edit Menu that shows “Copy to Clipboard”. This feature will allow you to copy data on a session to the Windows clipboard, so you then paste it into Word or Excel.
Simply select Copy to Clipboard, click on the first line to be copied and then click on the last line to be copied. You can then paste those rows into Excel, which will automatically format them into the appropriate columns. Checkboxes will be translated as Yes (Checked) or No (Unchecked).


I checked your profile, there is no BaaN Version specified. You can try it out at your installation and let us know the results.

halvorn
2nd October 2002, 08:54
Hi NPRao,

This (Copy to Clipboard) is not present in Baan IV c4,
But we use to print to Notepad if we want Baan printouts in an other Windows app.

But still we have several users that are "browsers" to information, like pricelists, orders etc. They do not enter information and we think it is expensive to buy Baan licenses for such users.

And in many cases it is difficult and very slow to find information in Baan by using Tools / Query and .* etc.