@DBLookup using Script

Hi Experts,

I don’t know script at all… trying to evaluate the a @DBLookup when a dialog list value changes. In the OnChange event, I currently have:

Sub Onchange(Source As Field)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Call uidoc.Refresh

End Sub

Is there a way I can I make the following formula work in this script?

FIELD Account := @DbLookup(“”:“NoCache”;“”:“”;“DBLookup Data - Account Data”; Flag04; “Account”);

Thanks, Paul

Subject: Look in domino designer for getdocumentbykey

Subject: Thanks but…

Thanks Carl but that appears complicated especially since I actually want to make around 5 DBLookup calls at once.

Can the “evaluate” function work? I tried but could

Account = Evaluate ({@DbLookup(“”:“NoCache”;“”:“”;“DBLookup Data - Account Data”; Flag04; “Account”)},doc)

But it didn’t set Account to the result.

Any suggestions here?

Thanks, Paul

Subject: Not sure I would describe that as complicated, if you’re already writing Lotusscript.

http://www.lmgtfy.com/?q=domino+evaluate+dblookup

The reason why your code isn’t working, is posted in the first thread in the search results, and relates to how you have Flag04

This week I’ve seen two posts by IBMers which are taking horrible approaches to their solutions, because “it’s complicated” or couldn’t cut and paste the solution.

Subject: I don’t know script

Hi Carl,

I understand what you are saying but I don’t know script. I’m a mechanical engineer supporting this database. Whatever script is there, which is very little, was written by someone else. The evaluate call seems like it would be simple but I can’t seem to get it to work… Here is my code… please help… :slight_smile: The “Account” field is not being updated.

Sub Onchange(Source As Field)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument



Account = Evaluate ({@DbLookup("":"NoCache";"":"";"DBLookup Data - Account Data"; Flag04; "Account")},doc)



Call uidoc.Refresh

End Sub

Thank you, Paul