Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2002-04-16
6
Medium Priority
?
293 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 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

604 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