Accessing Information from a different NSF

Hi Experts,

   I am trying to build a form in NSF A which contains a field name Vendor.  I pick the Vendor out of the Vendor NSF (Address book).  When I get the name of the Vendor, I used  @Dblookup with the [ReturnDocumentUniqueID] option.  I was thinking to use @GetDocField to get the Vendor's address, contact person, etc, but then I found out that @GetDocField only works for the current Database.  

So, is there a way to get the field values of a particular vendor?  
Do I need to build a view with the needed field values in the Vendor NSF?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Yupe. You may create a view and put all the needed fields in on the view.
You can use Dblookup to  get all specified column in the view.
Here you get the values and you can manipulate it.

I havent test out thie approach yet, but I think you can play around with the retrieved values.  :)

Sjef BosmanGroupware ConsultantCommented:
1) create an additional view in the Vendor db, for multiple consecutive @DbLookup calls:
    vdname:= @DbLookup("":"NoCache"; "vendor.nsf"; "viewname"; column; key; "Name");
    vdaddr:= @DbLookup(""; "vendor.nsf"; "viewname"; column; key; "Addr");
2) write it in LotusScript; in pseudo-code:
    open the 2nd db
    open the view
    search for the vendor-document based on the key
    get all fields you need
3) is like 1), but faster:
    create the view with one column that contains a formula like
    Only one @DbLookup is required, to get all the data
        data:= @DbLookup("":"NoCache"; "vendor.nsf"; "viewname"; column; key; column_number);
    To get individual values, use
        name:= data[1];
        addr:= data[2];

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I think you made a mistake, these are two versions of @DbLookup:

    @DbLookup( class : cache ; server : database ; view ; key ; columnNumber ; keywords)
    @DbLookup( class : cache ; server : database ; view ; key ; fieldName ; keywords)

so without your column parameter.

you don't need Doc's UNID, you allready have the doc looked up - simply specify the fieldName in double quotes.

I also suggest you to include the fields in the lookup view.
That way the formula wont search the whole document till it founds your "fieldName" field, instead it will simply look up the value in the specified column.
If you don't get the value you expect look at designer's help on DbLookup about counting the columns when specifying that param.

Hope this helps,
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Sjef BosmanGroupware ConsultantCommented:
Correct. It's not my day, I think... :-|
it happens, you probably wrote about DbLookup and thought about DbColumn :)

For me you're still first :))

Hi damrakandy,
In addition to the other posts, in my parsimonious days, I would create the view with the first column being the lookup value, and the second column being the concatenated value of all the fields I need for the lookup.. i.e. name + " |" + address + " |" + city + " |" + state + " |" + zipcode + " |"

Then my @dblookup checks for the first column, returns column2,
returnval:=@if(@isError(theVal) | theVal="";"something";theVal);

Then you use @Word(theVal;"|";1);@Word(theVal;"|";2), etc. to set the values in your form, or you can @Explode(theVal;"|") and use theVal[0], theVal[1] to access the data.

The value is one lookup, one return value.

But, in this day an age, all above are valid ways to perform the same function.. just depends on how many lookups you have :)

Sjef BosmanGroupware ConsultantCommented:
Option 3a...  ;)
damrakandyAuthor Commented:
Hi All,

damrakandyAuthor Commented:
Hi All,

  Thanks for all of your helps!  sjef_bosman will get the points.

Sjef BosmanGroupware ConsultantCommented:
Thanks :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.