Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


This may be a challenge...inheritting information from a saved form via dialog choice

Posted on 2003-12-01
Medium Priority
Last Modified: 2013-12-18
OKay.  I have a database where I enter in a calltrack and then save.  There would be clients who are repeated multiple times.  Currently, to inherit data, we go through views, find the client, select the calltrack, and open a new form, which inherits the data.

Is there any way, in my form, to have a button that will bring up a dialog box containing that view, or some variation of it, where if I am already in the form, I just simply hit the button and choose the client name for the information I want to inherit from already saved forms in the database?

Does this make sense?
Question by:brianbailey
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 3
LVL 24

Expert Comment

ID: 9852309
Use @PickList (function or script equivalent)

The picklist will return the column value of the selected row.

LVL 24

Expert Comment

ID: 9852317

choice:=@PickList( [Custom] : [Single] ; @DbName ; "Products" ; "Select a product" ; "Please select the products you want to order" ; 2 );

Opens the products view and set choice variable to second col of the selected row.

Author Comment

ID: 9852519
OKay...that brings in a single field (the one indicated by that "2" column).  I was hoping to bring in several fields at once:

Company Name:
Phone Number:
Email Address:

is there a way to select the call from the dialog and have it populate all 4 of these fields?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 24

Expert Comment

ID: 9852588
concat all the fields and hide it, use that column number

Concat like this in column formula

Company Name + "~" + Caller + "~" + Phone Number + "~" + Email Address

When you capture the value of the col, it will give you values delimited with ~ so break it like this

choice:=@PickList( [Custom] : [Single] ; @DbName ; "Products" ; "Select a product" ; "Please select the products you want to order" ; 2 );
Company Name := @Word( choice; "~"; 1);
Caller := @Word( choice; "~"; 2);
Phone Number := @Word( choice; "~"; 3);
Email Address := @Word( choice; "~"; 4); ""

Author Comment

ID: 9852644


Have you forgotten me already?  As soon as you used the word "concat" you lost me.  What do you mean by concat?  I think I might be catching on to what you are saying, but I am not sure.
LVL 24

Expert Comment

ID: 9852719
I meant concatenate.

LVL 31

Expert Comment

ID: 9852901
If you are getting a few fields, the following code in a button can do it nicely:

      Const sourceToDestinationFieldMap = "Subject=SendTo,PostedDate=CopyTo" 'example: lookup subject, place in sendTo; then lookup postedDate, place in copyTo
      Const VIEW_NAME = "($All)"
      Dim ws As New notesUiWorkspace
      Dim form As notesUiDocument
      Set form = ws.currentDocument
      Dim db As notesDatabase
      Set db = form.document.parentDatabase
      Dim docs As notesDocumentCollection
      Set docs = ws.PickListCollection( PICKLIST_CUSTOM ,, db.server,db.filePath , VIEW_NAME , VIEW_NAME,"Pick client")
      If docs.count = 0 Then
            Print "Cancelled"
      End If
      Dim doc As notesDocument
      Set doc = docs.getFirstDocument
      Dim fieldList As Variant
      doc.sourceToDestinationFieldMap = sourceToDestinationFieldMap
      fieldList = Evaluate(|
mapList := @Explode(sourceToDestinationFieldMap; ",");
sourceFields := @Left(mapList;"=");
FIELD sourceToDestinationFieldMap := @Right(mapList; "=");
      Dim index As Integer, sourceField As String, sourceValue As String, destField As String
      For index = Lbound(fieldList) To Ubound(fieldList)
            sourceField = fieldList(index)
            sourceValue = doc.getItemValue(sourceField)(0)
            destField = doc.sourceToDestinationFieldMap(index)
            Print "Setting field " destField " to " sourceValue " (from source field " sourceField ")"
            form.fieldSetText  destField , sourceValue

Author Comment

ID: 9852961
Oh my.

NOVICE!!! NOVICE!!!  *points to self*


That seems a bit too complicated for me, but would be great as a button.  However, just looking to do it as the initial creation popup dialog right now.


I did what you said and nothing errored, but nothing populated either.  Does it matter what field i place the following in:

choice:=@PickList( [Custom] : [Single] ; @DbName ; "0.0 Caller Index" ; "Select Data to Inherit" ; "Please select Client Data to Inherit" ; 6 );
CLIENT:= @Word( choice; "~"; 1);
NAME:= @Word( choice; "~"; 2);
PHONE:= @Word( choice; "~"; 3);
eMail:= @Word( choice; "~"; 4); ""

The 6th column of "0.0 Caller Index" contains the following:

CLIENT + "~" + NAME + "~" + PHONE + "~" + EMAIL

LVL 31

Expert Comment

ID: 9853045
Hey, a novice shoudl be able to use that code as-is, with thefollowing setup issues:

1) create the button
2) change it from FORMUAL to LOTUSSCRIPT
3) Paste the code in between the Sub Click / End SUb that appears
4) Change the two lines at the top, using appropriate values (CONST VIEW_NAME and CONST sourceToDestinationFieldMap)


Author Comment

ID: 9853159
I was fine until step 4...what would I want to indicate if:

NAME maps to NAME

Also, would it be ?:
 Const VIEW_NAME = "0.0 Caller Index"

LVL 24

Expert Comment

ID: 9853195
Well you have to set it to field rather than variable.. here is the formula

choice:=@PickList( [Custom] : [Single] ; @DbName ; "0.0 Caller Index" ; "Select Data to Inherit" ; "Please select Client Data to Inherit" ; 6 );
FIELD CLIENT:= @Word( choice; "~"; 1);
FIELD NAME:= @Word( choice; "~"; 2);
FIELD PHONE:= @Word( choice; "~"; 3);
FIELD eMail:= @Word( choice; "~"; 4);


Author Comment

ID: 9853359
It worked for phone and email, but not Client or Name (put the formula in the Client field).  I must be missing something.
LVL 24

Accepted Solution

HemanthaKumar earned 252 total points
ID: 9853467
Probably data is null.

Just prompt out and see what is the value you are getting back from view

@Prompt([ok]; ""; Choice) after picklist call

Author Comment

ID: 9853524
It shows all 4, in the correct order.  The only thing that it might have a problem with is that Client and Name are more than one word each (ie. Jane Smith~Example
LVL 31

Assisted Solution

qwaletee earned 248 total points
ID: 9854525
> NAME maps to NAME
> etc.

> Also, would it be ?:
>  Const VIEW_NAME = "0.0 Caller Index"

     Const sourceToDestinationFieldMap = "Client=Client,Name=Name"
     Const VIEW_NAME = "0.0 Caller index"

Please note: good programming practices in Notes call for NOT using user-visible views for looking things up progarmmatically, ecause who knows what the user might request that you change in "their" views later?  Another good practice is to use the view comment to identify where you have used the view progarmmatically, so that if someone decides that a lookup to it requires revision, you can figure out if there will be any side-effects to the change.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

704 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