seoclick
10th September 2009, 12:39
Dear all,
I've created one history table of a customized table. But I couldn't find any function which can return me the BAAN login name who is doing the transaction.
Usually, logname has a great significance in a history table. Please advice me.
Thanks in advance.
seoclick
10th September 2009, 13:13
Dear All,
I've found the answer from Mr. Mark_h's Post.
The function is LOGNAME$
Thanks to all.
Regards,
Seoclick
frigyesg
17th September 2009, 14:17
Hi,
logname$ is a predefined variable, not a function. Just to be more specific, where this can be found in the programmers guide.
bdittmar
17th September 2009, 19:52
Hi,
logname$ is a predefined variable, not a function. Just to be more specific, where this can be found in the programmers guide.
Hello,
BaanERP Programmers Guide
Predefined variables
--------------------------------------------------------------------------------
The following is a list of the predefined variables available to programmers. Variables specific to a particular function or group of functions are listed with those functions.
4 = 4GL only; R = Read-only
Type Name Description
long lattr.* See Report scriptsReport_scripts.
string logname$(16) R Current login name.
string main.table$(9) 4R Name of current main table.
aso....
Regards
GabrielVA
20th September 2010, 14:51
How would I link an employee number with the logname$ or is that possible? I have a field that produces the loginname$ with no issue, but the end user also wants to show the employee ID number next to that field in another field. Any ideas there?
Example:
Current User: Gabriel 123456
Gabriel= logname$
123456 = employee number from table
Just need to have the logname$ = employee number then display it.
Any thoughts or guidance would be grateful here.
GabrielVA
bdittmar
20th September 2010, 15:09
How would I link an employee number with the logname$ or is that possible? I have a field that produces the loginname$ with no issue, but the end user also wants to show the employee ID number next to that field in another field. Any ideas there?
Example:
Current User: Gabriel 123456
Gabriel= logname$
123456 = employee number from table
Just need to have the logname$ = employee number then display it.
Any thoughts or guidance would be grateful here.
GabrielVA
Hello,
in BaaN 4 :
Use field tccom001.namc for logname (e.g. "gabriel")
Compare logname$ with this field an you'll get tccom001.emo and all others.
Regards
mark_h
20th September 2010, 15:15
Well - there is depending on how you set your system up. For example how did you do employee name (employee table) and name on user table(user setup)? If you did those the same you might be able to match them. Or if you wanted you could put user name in something like email on the employee table.
GabrielVA
20th September 2010, 15:35
Thanks Mark & Bernd. Can you give me an example of how i would compare the fields? I assume this needs to be in the script in order to compare.
mark_h
20th September 2010, 15:44
Our system is not setup correctly. So for my employee ID I have H, Mark(tccom001.nama) and then for user id I have Mark H(ttaad200.name). So I would have to write a function to switch the ttaad200.name to H, Mark. If they were both setup correctly you could just use tccom001.nama = ttaad200.name - might have to strip spaces.
GabrielVA
20th September 2010, 15:49
Gotcha! Ill tyr this out and let you know how it works out! Thanks mark.
GabrielVA
21st September 2010, 13:49
Hello Guys-
OK so looking at the tccom001 table (maintain employees) I don't see any sort of user name field to compare logname$ so I can then also display an employee id. I do see employee number and name (full name). Where could I find information that has the logname$ though? Or is there a way that I could take the ttccom001 info and somwhow use logname$ to convert something? Maybe Im just missing something here.
TTCCOM001 Screenshot (http://www.geekzee.com/Baan/ttccom001.docx)
Kozure Ohashi
21st September 2010, 14:05
There is no direct link between logname and employee id (or name).
But if your logname e.g. is 8 carachters (1st of firstname, 7 of lastname) you could get a match like
logname: mbagetta
tolower$(tccom010.nama) = "mike bagetta" and then make a string search to find "bagetta" in the Name field.
Then you have the employee id.
But this is fuzzy logic, not 100 % but sometimes good enough.
Better if your masterdata in tccom001 is:
Name: Bagetta
Name2: Mike
to separate first and last name so you could compare mbagetta with mbagetta. But what if you hafe many smith or miller in your company, asmith, asmith2 or adsmith. It depends on your naming convention.
Other possibilities:
* you make a additional table to mapp employee with logname
* read a textfile from the server where the mapping is done
* you have an unused field in the employee table to store the logname
* Writing employee id in the ttaad200.name field e.g. Mike Bagetta (1) (and filter the brackets, other id could be (4251)).
* Using SMI modul (tdsmi) to mapp contact persons to a business relation, here you could store the information (logname, employee id, name).
Regards,
Kozure
GabrielVA
21st September 2010, 14:16
Hmm. I dont think that would work as the name field is the entire last name as in the example. 'bagetta', the user id or logname$ may be mbagett for example while the employee number that im trying to show in the example is the number 1. Im suprised that theres not an easy fix for this in BaaN IV.
bdittmar
21st September 2010, 18:32
Hmm. I dont think that would work as the name field is the entire last name as in the example. 'bagetta', the user id or logname$ may be mbagett for example while the employee number that im trying to show in the example is the number 1. Im suprised that theres not an easy fix for this in BaaN IV.
Hell,
Kozure has shown possible ways to solve your requirement.
You have three informations sources, you are able to use :
logname$
ttaad200
tccom001
Based on the setup on your system, you'll have to find your own way.
Regards
GabrielVA
21st September 2010, 19:19
Thanks Bernd,
I would agree that I would need to find my own method of getting this. Looking at the data setup, it is not possible to achieve what I've been tasked to do. In order to make this work, I will have to write in an employee ID number in the ttaad200 table or make another table to map the employee with the logname$. Thanks for everyones input on the matter here.
GabrielVA
GabrielVA
29th September 2010, 14:42
Is there another predefined variable like logname$ that I could use that shows then entire employee name???
mark_h
29th September 2010, 15:38
Not that I am aware of.
shah_bs
1st October 2010, 15:14
Assuming that you have updated the name in the Maintain User session, you could use the function tt.user() to get the user name. If this name is exactly identical to the Employee Master name, it may be possible to 'link' but this is a very person dependent link - one spelling mistake and the link will not work.
Also, as you must know, tccom001.nama is 35 characters whereas ttaad200.name is 30 characters.
Alternatively, as a 'procedure', you could RESERVE tccom001.name, which is 30 characters, and make sure that it is always identical to ttaad200.name, and use these two fields to create a link.
Still, not very sturdy approach.
The better approach is the one you suggested of having a new table to create a cross-reference between tccom001.emno and ttaad200.user and write your own library functions to get from the one to the other, using logname$.