Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieving data from manager field

Status
Not open for further replies.

llevaillant

Technical User
Jan 24, 2002
20
0
0
FR
Hi,

We are trying to do something that we thought would be very simple : get the value of the manager field for someone (the person has two managers in the address book, we want her to be able to choose between them). The code does not return anything :
x:=@DbLookup("":"NoCache";"":"";"Viewname";VDPDocumentCreator;"Manager");
@if(@iserror(x);"";x)

VDPDocumentCreator contains the name of the person.

Thanks in advance

Laurence

 
Where is the code executing from - a document, or an agent ?
Second, viewname as name of view is wrong, you need to put in the design name of the view you are using. Third, make sure the view is formatted correctly, and has first column sorting, else the @dblookup will fail.

Correct these issues and keep us posted :)

Pascal.
 
The code is executing from a document.
"Viewname" was just an example, in fact the view is called vuenom, what do you mean by formatted correctly ?

The first column is sorted (alphabetical order, A to Z).

We have changed the code a bit since (view was not found), and now the error is : Server error entry absent from the index (this is translated from french)

vUser := tmp + " " ;
vUserF := @Right(vUser; " ") + " " + @Left(vUser; " ") ;
@DbLookup("":"NoCache";"Kermit/EURAMAXFR":"Names.NSF";"Vuenom";@Trim(vUserF);2)

Any idea ?

Thanks in advance
 
By formatted correctly I mean that the first column needs to be sorted (you did that) and you need to be sure that the info is either available in the view columns at the right place.
Apparently, your code expects the names to be in column 2. I suppose your view has a 2nd column with the names.

Given the new error, are you sure that the view is still in the server NAB ? It could be erased by the nightly template update if you did not include it in the template.

Second question : have you heavily modified the NAB template ? If so, control that you still have a Default View and a Default Form - the view default is essential for a lookup to function correctly.

Third idea : is the writing of Names.NSF the exact writing of the db name. I guess it is.

Fourth idea : why use anything but the canonical name of the user (as in @username) ? Sort you users by canonical name in the first column, and use @username. That will avoid not finding docs because your name parser makes a mistake.

Other than that, I've no idea what could be wrong for the moment.

Keep us posted,

Pascal.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top