Prompt user for a value - set the value in a field on a new form

I want to hit a button from the $inbox folder which should result in this: - prompt the user for a value

  • compose the memo form and put the prompt-value in the field SendTo

I’ve tried this formula but the field SendTo is empty after the memo is composed. How can I solve this?

CopyTo := @Prompt([OkCancelEdit]; “Name”; “Please enter the name”; @UserName);

@Do(@Command([Compose]; “memo”))

Subject: prompt user for a value - set the value in a field on a new form

SendTo:=@Prompt([OkCancelEdit];“Name”;“Please enter the name”;@UserName);@URLOpen(“mailto:”+SendTo+“?subject=Nice Subject”);

This will work, since Lotus Notes is your default e-mail program, and you can use the general standard mailto: syntax, to populate the SendTo, CopyTo, BlindCopyTo, Subject, Body, etc… fields.

http://www.ianr.unl.edu/internet/mailto.html

Subject: thank you, worked perfect!

Subject: RE: prompt user for a value - set the value in a field on a new form

Cool. Will this work in the Notes client? I would probably have gone down the road of environmental variables but this way is easier.

Subject: RE: prompt user for a value - set the value in a field on a new form

Yes, it is meant to work in the Notes Client in first place, the @Prompt thing won’t even work from the Web Client.

Subject: RE: prompt user for a value - set the value in a field on a new form

No I was talking about the mailto URL. That was slick and very easy.

Subject: RE: prompt user for a value - set the value in a field on a new form

Me too, I was talking about the whole agent including the mailto: command :slight_smile:

Subject: prompt user for a value - set the value in a field on a new form

Try this

CopyTo := @Prompt([OkCancelEdit]; “Name”; “Please enter the name”; @UserName);

@Do(

 @Command([Compose]; "memo");

 @Command([EditGotoField]; "CopyTo");

 @command([EditInsertText];CopyTo)

)

Subject: RE: prompt user for a value - set the value in a field on a new form

If you’re doing it this way, I would rather use

CopyTo:=@Prompt([OkCancelEdit]; “Name”; “Please enter the name”; @UserName);

@Command([MailComposeMemo]);

@Command([EditGotoField];“CopyTo”);

@Command([EditInsertText];CopyTo)

because then you don’t need to put this agent in your mail database. The only problem that remains is that not everyone uses the fieldname “CopyTo”, especially if you have a custom-made mail template. But I guess in practice everyone uses the same fields as in the original Lotus mail template, unless they have a specific reason to keep the documents different from the outgoing mails to the mail.box(es).