We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

Accessing Information from a different NSF

damrakandy
damrakandy asked
on
Medium Priority
313 Views
Last Modified: 2013-12-18
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?

thanks,
andy
Comment
Watch Question

Commented:
Hi,

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.  :)

Lamdalam
Groupware Consultant
CERTIFIED EXPERT
Commented:
Options:
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
        Name:Addr:...
    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];
        ...

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
sjef_bosman,
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.

damrakandy,
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,
Marko
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Correct. It's not my day, I think... :-|

Commented:
sjef,
it happens, you probably wrote about DbLookup and thought about DbColumn :)

For me you're still first :))

Marko

Commented:
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,
theVal:=@dbLookup("":"NoCache";server:db;"view";key;1);
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 :)

Regards!
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Option 3a...  ;)

Author

Commented:
Hi All,

Author

Commented:
Hi All,

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

andy
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Thanks :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.