Avatar of David Schmalzer
David SchmalzerFlag for United States of America

asked on 

formula script equivalent

What would be the script equivalent of this formula?

@Text(@DbLookup("Notes":"Nocache" ; "Servername":"database.nsf"; "SOLV" ; batch ; 2 ));
@If( @IsError(so); "na"; so);
Lotus IBM

Avatar of undefined
Last Comment
David Schmalzer
Avatar of David Schmalzer
David Schmalzer
Flag of United States of America image

ASKER

And, will I be able to tag it on to the end of an existing script?
Avatar of HappyFunBall
HappyFunBall

Dim s as New NotesSession
Dim db as NotesDatabase
Dim view as NotesView
Dim doc as NotesDocument
Dim key(0) as String

Set db = s.CurrentDatabase
Set view = db.GetView("SOLV")
key(0) = batch
Set doc = view.GetDocumentByKey(key, True)
If doc Is Nothing Then
  Messagebox "na"
Else
  Messagebox so
End If

I'm not sure of the context of this code, so you may want to change the messageboxes into return values of a function or to set some fields on a form, etc.

Avatar of HappyFunBall
HappyFunBall

No reason you can't tag it on the end of a script.  But like I said above, you'll need to add more code depending on what that @formula was returning to.  If that @formula was in a form field, then you'll need to add some code to set that field via the script.
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

I think the eaxct equivalent would be
    ""

I assume your Formula is not correct, semantically...
ASKER CERTIFIED SOLUTION
Avatar of HappyFunBall
HappyFunBall

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of David Schmalzer

ASKER

:)  It works, I have it in a computed field, computed when composed. I just wanted to put it at the end of another script.
Avatar of mbonaci
mbonaci
Flag of Croatia image

schmad01,
Notice "OR" in the definition from designer's help:

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


Marko
Avatar of HappyFunBall
HappyFunBall

Unless I'm missing something, schmad01's formula fits the first type of @DBLookup.  What were you getting at Marko?
Avatar of mbonaci
mbonaci
Flag of Croatia image

It works by accident :)
It has an error, he has put fieldName and columnNumber in it, he merged two versions of formula.

The lucky part (but I would rather say it's unlucky) was that Lotus thought number 2 is keyword so he just ignored it.


Keywords are:
[FAILSILENT] [PARTIALMATCH] [RETURNDOCUMENTUNIQUEID]


Marko
Avatar of HappyFunBall
HappyFunBall

"keywords" are optional, right?  If so, check the number of parameters again.  The formula looks right to me.
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

Of course if you are really lazy....

dim batch as string
batch = doc.batch(0) or whatever
Evaluate | @Text(@DbLookup("Notes":"Nocache" ; "Servername":"database.nsf"; "SOLV" ; | & batch & | ));  |

Steve
Avatar of Steve Knight
Steve Knight
Flag of United Kingdom of Great Britain and Northern Ireland image

(an obviously doing something with the result of evaluate.... i.e.  result=evaluate |  sdsdjksjskd  |
Avatar of David Schmalzer

ASKER

Thanks alot.
Lotus IBM
Lotus IBM

Lotus Software produced the Lotus 1-2-3 spreadsheet program, and later developed Lotus Notes, a groupware and email system. Following its acquisition by IBM, the Notes and Domino client/server collaborative platform were expanded to include functions such as email, calendars, to-do lists, contacts management, teamrooms, discussion forums, file sharing, microblogging, instant messaging, blogs, and user directories. IBM also release SmartSuite, a comprehensive office suite, and followed that with Symphony, unrelated to the Lotus suite of the same name.

21K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo