• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

Multiple Names in Sending Email Problem

I have a field AA that is setup to allow Multiple Names.  It is using a semicolon to seperate and displaying with a semicolon.  So the field looks like this

Jaziar/com/Company; Tom/com/Company

Then I have a action button to send a email to the the users in AA

Mail = @Trim(AA)

then @Mailsend

The problem is that the email is getting stuck thinking Jaziar/com/Company; Tom/com/Company is one name


0
Jaziar
Asked:
Jaziar
  • 7
  • 7
  • 2
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Is the semicolon defined as one of the separators in the field?

Do you have @MailSend without parameters, or with a lot of them?

If need be, use @Explode(Mail; ";")
0
 
marilyngCommented:
For @MailSend to work, you either have to have the common fields on the form:  sendTo; CopyTo; BlindCopyTo;Subject;Body,

or you have to specify them in the command;

@MailSend( sendTo ; copyTo ; blindCopyTo ; subject ; remark ; bodyFields ; [ flags ] )

----------
Now, if this is a new form and you attempt to do:

Mail:=@Trim(AA);
@MailSend

Then you will get the "No names to send mail to" message.

If, instead, you do:

@MailSend(AA;"";"";SubjectField;"";PlainTextBodyField;[Flags]);

See the designer help for @MailSend.

You can specify a rich text field as one of the bodyfields in an agent formula only. <<<Note>>>

Your choices:
   If you put a computed sendTo Field on the form, and in your action button, refresh the fields so that the sendTo value is refreshed with the values from AA,  then your mail gets sent, but the RICH TEXT body field doesn't go, only Plain text fields, or information that you concatentate and add to the bodyfields part of the formula:

Message:="This is the result: " + resultfield + @Char(13) + "Another Bit of Information: " + informationfield;
@MailSend(AA;"";"";SubjectField;"";Message;[Flags]);


OR make sure you have the requisit computed fields: sendTo ; copyTo ; blindCopyTo ; subject;

And in your button select "simple actions" then select "Send Document" - then the whole document goes.  
Caveat (if there are hidden fields on the document that reference the database, you need to figure out how to deal with them, else users will be treated to a bunch of errors trying to open the document, and when the computed fields can't complete the lookup, etc.)
0
 
Sjef BosmanGroupware ConsultantCommented:
That's my drift, yes...
0
Independent Software Vendors: 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!

 
marilyngCommented:
Solly, did I stomp on your answer?
0
 
JaziarAuthor Commented:
OK my bad, for not explaining fully.  I use @mailsend all the time and know how to set it up.

This is the actual code I am using for the button

comment_1 := @Prompt([OkCancelEdit]; "Info Req'd"; "Please Input Commment For AA"; " ");
comment_2 := "Info Req'd: " + comment_1 + @NewLine + @NewLine;
HudMail := @Trim(AA:AADialog);
SurMail := @Trim(AA:AADialog);

observer_message := comment_2 + "Please fill in the remaining fields in the Employee Activity Form to complete this record." + @NewLine + @NewLine + "Employee Name: " + UFirstName + " " + ULastName + @NewLine + @NewLine + "Click on attached link for the partially updated form.";
subject := "Please complete actions for Employee Activity Form" ;
@Command([FileSave]);
@If (UVP = "Smith";
  @MailSend(SmithMail; ""; ""; subject; ""; observer_message + @NewLine+@NewLine; [IncludeDoclink]);
  @MailSend(SurMail; ""; ""; subject; ""; observer_message + @NewLine+@NewLine; [IncludeDoclink]));

@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])

The field AADialog has the value Jaziar/com/Company; Tom/com/Company
even if I display the field using commas, when it tries to send the mail it comes up with semicolons.  Sorry for the confussion.
0
 
Sjef BosmanGroupware ConsultantCommented:
Would there by any chance be a computed field AADialog in the form that gets its data from some other multivalue field? And is the AADialog field set to multi value?
0
 
JaziarAuthor Commented:
Yes there is a Userform that has a multivalue field AA, it is also set up to seperate on comma and display using comma, that then feeds to a view, then the AADialog field is editable but has this has a default value

test := @If(@IsNewDoc; @DbLookup("":"NoCache";""; "(UserRole)"; @UserName; "AA"); AA);
@Name([CN]; test)
0
 
Sjef BosmanGroupware ConsultantCommented:
I assume (beware, that's not my strongest point) that there is one field being used in these computations that is NOT multi-value. That is the only implicit conversion from multi-value to imploded single value. It could also be the column in the DbLookup, meaning that the AA field in existing(!) documents has a text-value with a semicolon in it.
0
 
JaziarAuthor Commented:
It has to be in the column then, because I know both fields are set up correctly.
0
 
Sjef BosmanGroupware ConsultantCommented:
Then use
    test := @If(@IsNewDoc; @DbLookup("":"NoCache";""; "(UserRole)"; @UserName; "AA"); AA);
    @Prompt([Ok]; "test elements"; @Text(@Elements(test)));
    @Name([CN]; test)
to find out whether your assumption is correct.
0
 
JaziarAuthor Commented:
that dont throw the prompt it displays as it should
0
 
JaziarAuthor Commented:
Sorry it did - give me a number 2
0
 
Sjef BosmanGroupware ConsultantCommented:
A 2? That means that test is actually a list of length 2! Sorry, it's not the @DbLookup...
0
 
JaziarAuthor Commented:
I found the problem, you where right before - there was a field in the email that was not Multivalue.  - Thanks for staying with me on this.
0
 
Sjef BosmanGroupware ConsultantCommented:
Glad you've found it!
0
 
JaziarAuthor Commented:
thanks for your help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 7
  • 7
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now