Solved

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

Posted on 2002-04-16
6
279 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

20 Experts available now in Live!

Get 1:1 Help Now