Solved

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

Posted on 2002-04-16
6
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

733 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