Solved

@dbLookup field ... value is a constant '1'  ??

Posted on 2002-04-16
6
280 Views
Last Modified: 2013-12-18
Have a form with three fields....Requested By <ReqBy>, Requested by Phone <ReqbyPhone> and Requested by Division <ReqbyDiv>.  The Requested by field is a dialog list, editable, choose from Address book dialog.  The Requested by Phone and Division are to be populated dependant upon the choice made in the Requested by field....using an @dbLookup formula...
@If(ReqBy !="")  ;

lkupVal := @dblookup("Notes":""; "123.nsf"; "People"; ReqBy; 2);
Field ReqbyPhone := @word(lkupVal;"Y";1);
Field ReqbyDiv := @word(lkupVal;"Y";2);
@Success;

So when I test the form, the fields ReqbyPhone and Division show the value '1' and are not changable.  These two fields are text /computed...

What have I done wrong now?

help :)  thanks in advance
0
Comment
Question by:Paulette
6 Comments
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 50 total points
ID: 6946097
@Success is will always return 1.

So here is the deal,create a field computed for display field lkupval with following formula

@If(ReqBy !=""; ""; @Return(""))  ;
list := @dblookup("Notes":""; "123.nsf"; "People"; ReqBy; 2);
@if( @isError(List); ""; list)

Similarly Field ReqbyPhone formula will be
@if( lkupval = ""; @Return(""); @word(lkupVal;"Y";1) );

Similarly Field ReqbyDiv formula will be
@if( lkupval = ""; @Return(""); @word(lkupVal;"Y";2) );

~Hemanth


0
 
LVL 10

Expert Comment

by:zvonko
ID: 6946110
Hello Paulette,

you omitted the server name right hand to the DatabaseName name ("123.nsf"), that is all.

Here a working version:
FIELD ReqBy:=ReqBy;
@If(ReqBy="";@Return(ReqBy);"");

lkupVal := @DbLookup("Notes":""; "":"123.nsf"; "People"; ReqBy; 2);
@If(@IsError(lkupVal);@Return(ReqBy);"");
FIELD ReqbyPhone := @Left(lkupVal;"Y");
FIELD ReqbyDiv := @Right(lkupVal;"Y");
ReqBy

Regards,
zvonko

PS: Also would be good another value for the separator character, perhaps pipe char: |

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6946116
PS.PS: Also does @Success give a hint you use InputValidation of the ReqBy field for populating ReqbyPhone and ReqbyDiv field.
Better place for the lookup formula would be the InputTranslation event of the ReqBy field.


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Paulette
ID: 6946159
Hemanth

The field I am creating, is it a separate field from my Requested by field?  A hidden field maybe?

thanks in advance
0
 
LVL 8

Expert Comment

by:Jean Marie Geeraerts
ID: 6946974
I think what Hemanth is trying to say is the following :
Set in your dialog field <ReqBy> the property "Refresh fields on keyword change" on the second tab of the field properties.
This will automatically refresh other fields when you make a selection from the dialog list.

Then your other two fields should be computed for display with the formula's Hemanth suggested, or you can use the formula's as provided by zvonko.
He's right, you need to specify both server and database name to open the database. If the database is on local, the server is "", otherwise you need to specify the server name. If this is a lookup in the current database you can use @DbName.

An example:
lkupVal:=@DbLookup("Notes":"NoCache"; "servername":"123.nsf"; "People"; ReqBy; 2);

or if you are looking in the current database:
lkupVal:=@DbLookup("Notes":"NoCache"; @DbName; "People"; ReqBy; 2);

Hope this helps,
JM
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 6947484
Yes Paulette, lkupval will be hidden field . Sorry I din't notice that the dblookup was missing server parameter. Should be a typo I suppose.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now