Hello all:I have created a button to look up in a view that I created in the names.nsf database,this view is sorted by employee id,my formula is
@SetField(“Employee”;@DbLookup(“”:“”;@Command([FileOpenDBRepID];“C22456F0:0053DA74”);
@Command([OpenView];“Peoplebyid”);“009097”;“FullnameC”))
when I try running this formula I got the following error “Incorrect data type for database function”
what am I doing wrong
thanks in advance
regards
Dalia
Subject: That formula is totally wrong.
What do you want to do ? Then we can help.
Subject: RE: That formula is totally wrong.
what I want is set the field employee,with the vlue of :@Command([FileOpenDBRepID];“C22569F0:0053DA74”) -->names.nsf replica id
@Command([OpenView];“Peoplebyid”)–>view name
“009097” – is the key to lookup with
“FullnameC” -->is the field to return and fill employee field with
Hope it is clear and ok
thank you very much
Dalia
Subject: solution
From the Designer help:@DbLookup( class : “NoCache” ; server : database ; view ; key ; fieldName )
Putting your parameters in, results in this:
@SetField(“Employee”; @DbLookup(“”:“”; “C22569F0:0053DA74”; “Peoplebyid”; “009097”; “FullnameC”))
Subject: RE: solution
no, I got the same errorthanks
Dalia
Subject: RE: solution
Not the same error, that’s for sure. Your code was not based on Notes formulas as they exist in this universe. The worst that can possibly be wrong with what Jan offered is that the value doesn’t exist in the view and the @DbLookup is returning an error. The @DbLookup is perfectly formed, but if the result of the lookup is an error value, assigning it to another field could cause a problem. Try using the FailSilent keyword.
Subject: RE: solution
Thanks Stan,but I realy got the same error,also the view in the screen is the contact view which is the initial view of the address book ,so I think the problem is that you cannot build a view in the address book and use it for lookups
any way I try working around using another way
thanks
Dalia
Subject: RE: solution
“Same error message” – not “same error”. Of course you can create a view and use it for lookups. The only thing special about the address book is its name, when you reduce things to their most basic. Have you done the basics? Things like making sure the first column is sorted, that the view name (or alias, if it has one) is spelled correctly, that the value you are looking up exists in the view, and so forth? Is the replica id correct? Is there a good reason for using the replica id instead of the database name?