Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

@picklist and several fields

594 views
Skip to first unread message

EddieZ

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
I may be using the wrong command, but here is what I'm trying to do...

I have a button on my form that brings up @picklist with a small view from
another database. The only thing that seems to work is that the modal box
appears. I would like the user to select one document in the modal view,
and have the contents of 3 fields be transferred to 3 fields on the current
form.

I can't even get the selected document to transfer a value from a single
column to the selected field.

Thanks in advance
EddieZ

ljpr...@my-dejanews.com

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
Just the other day I created an action button on a form to accomplish the
same task: display column values from a specified column / view / database in
a dialog box which prompts end-user to select an item from the list which is
then copied to a specified field on the form.

FIELD Category:=Category; @SetField( "Category"; @PickList( [Custom] :
[Single] ; @DbName ; "MyView" ; "Select Category" ; "Either pick from list
and click OK, or type value directly in Category field." ; 1 ))

* Category is the field on the form which receives the selected value. *
Before using @SetField, I declared the field, Category, using the FIELD
assignment formula: FIELD Fieldname:=Fieldname; * The @SetField formula
states that the value selected from @PickList should be posted to the
Category field. * Only one value [Single] from the first column (1) of MyView
in the current database may be selected. Omit [Single] if end-user can
select more than one item from list. Multiple items will post to the same
field. If so, make sure field properties are set to accept multi-value
items. Replace @DbName with server:file name.

If you succeed using this formula to enable the end-user to post the first
field value, experiment with @DbLookup to locate the selected document and
post the remaining column values to the other two fields on your form. I
hope this helps. L. ******************************************* In article

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Matt Silberstein

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
In comp.groupware.lotus-notes.programmer I read this message from
"EddieZ" <Edd...@Bigfoot.com>:

>I may be using the wrong command, but here is what I'm trying to do...
>
>I have a button on my form that brings up @picklist with a small view from
>another database. The only thing that seems to work is that the modal box
>appears. I would like the user to select one document in the modal view,
>and have the contents of 3 fields be transferred to 3 fields on the current
>form.
>
>I can't even get the selected document to transfer a value from a single
>column to the selected field.
>

I use the following to do that:

Rem "Set up the parameters"
DBName := @Text(@DbName);
Server := @Subset(DBName; 1);
View :="(Hidden View)";
Title := "Title";
Prompt := "Prompt";

Rem "Get the user imput"
FIELD SSN := @PickList( [Custom] : [Single] ; Server : "" ; View ; _
Title ; Prompt ; 4 );
Database := "database.nsf" ;

ClassCache := "Notes" : "NoCache";

Rem "Use that input to get new values"
@Set ("View"; "(Full Info by SSN)" );
Key := SSN;
Col := 2;

FIELD FullName := @DbLookup(ClassCache ; Server : Database ; View ;
Key; Col) ;

@Set ( "Col"; 3 );
FIELD HomePhone := @DbLookup( ClassCache ; Server : Database ; View ;
Key; Col ) ;

@Set ( "Col"; 5 );
FIELD Company := @DbLookup( ClassCache ; Server : Database ; View ;
Key; Col ) ;
""

Matt Silberstein
-------------------------------------------------------
The Killing, Paths of Glory, Spartacus, Lolita, Dr Strangelove,
2001: A Space Odyssey, A Clockwork Orange, Barry Lyndon,
The Shinning, Full Metal Jacket, and, last of all, but I hope
not the least, Eyes Wide Shut. I will miss him.

Dames

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
I think you're going to need to use a combo of @picklist (or @prompt, which
I find more useful) and @DBLookup. You can use the @Prompt to select the
document then use @DBLookup to retrieve the 3 fields. You'll have to do
three separate lookups. I'm not sure why you can't get the field to set.
Do you have an example of your code?

Either that or you could use script which would probably simplify the
process.

EddieZ <Edd...@Bigfoot.com> wrote in message
news:7f65np$2...@newsops.execpc.com...


> I may be using the wrong command, but here is what I'm trying to do...
>
> I have a button on my form that brings up @picklist with a small view from
> another database. The only thing that seems to work is that the modal box
> appears. I would like the user to select one document in the modal view,
> and have the contents of 3 fields be transferred to 3 fields on the
current
> form.
>
> I can't even get the selected document to transfer a value from a single
> column to the selected field.
>

> Thanks in advance
> EddieZ
>
>

Ralph en Monica Kersten

unread,
Apr 17, 1999, 3:00:00 AM4/17/99
to
If you need to fill multiple fields, avoid using multiple @DbLookup's: their
performance is too slow!
Simply concatenate the fields that you need into one string, using a unique
(set of) character(s). I usually use "#@".
Show e.g. column no. 1 only, but collect data from another HIDDEN column,
not to mess up the pop-up box.
Your formula then should look a little like this:

Choice:=@PickList( [Custom] ; server : file ; view ; title ; prompt ;
column);
Field FieldNo1:=@Word(Choise; "#@"; 1);
Field FieldNo2:=@Word(Choise; "#@"; 2);
Field FieldNo3:=@Word(Choise; "#@"; 3)

I think this returns an error when saving, but adding another line like

@Success

or

@Return("")

should deal with that.

If one of the fields is multi value you could think of another unique
separator (e.g. "#$") and @Explode the result of @Word, e.g.:

Field FieldNo2:=@Explode( @Word(Choise; "#@"; 2); "#$" );


Success!


Ralph Kersten


EddieZ heeft geschreven in bericht <7f65np$2...@newsops.execpc.com>...

EddieZ

unread,
Apr 20, 1999, 3:00:00 AM4/20/99
to
Thanks for all the great help everyone, I hope I get efficient enough with
lotus to return the favor. Got it working :)

Thanks
EddieZ

EddieZ <Edd...@Bigfoot.com> wrote in message
news:7f65np$2...@newsops.execpc.com...

0 new messages