?
Solved

More than one entry in mailto field causing @setfield to run twice?

Posted on 2010-03-24
2
Medium Priority
?
297 Views
Last Modified: 2013-12-18
@SetField("$hiddenjournal";$hiddenjournal+@NewLine+"["+@Text(@Now;"D0")+ "] "+@Name([CN]; @V3UserName)+" sent the following Notification to "+@Name([CN];$hiddenmailto)+@NewLine+$hiddendeletionrequest)


This part of my code below is getting run multiple times if there are multiple names set in the $hiddenmailto field.
Is there anyway I can put the $hiddenmailto into this @setfield formula without it doing this?

Thanks scribla.
@SetField("$hiddenmailto";"");
@SetField("$hiddenmailto";@PickList( [Name] ));
@SetField("$hiddendeletionrequest"; "");
@SetField($hiddendeletionrequest;@DialogBox("NotifyForm";[AutoHorzFit]:[AutoVertFit]:[OkCancelAtBottom]; "Message/Reason for Notification"));

@If($hiddendeletionrequest="";@Prompt([Ok]; "Notification cancelled"; "Your message cannot be empty");

@MailSend($hiddenmailto;@If(@Prompt([YesNo]; "CC?"; "Would you like to be copied in on this notification?" );@UserName;"");"";@Text("EEB Notification: ")+@Text(EnquiryNumber)+" "+@Text(Clientname);



"Hi "+@NewLine+@NewLine+"You have been sent this Electronic Enquiry Book notification by "+@Text(@Name([CN];@UserName))+" regarding enquiry "+@Text(enquirynumber)+" "+@Text(clientname)+" - "+@Text(scopeofwork)+@NewLine+@NewLine+@Text(@Left(@Name([CN];@UserName);" "))+"'s message: "+@NewLine+@Text($hiddendeletionrequest)+@NewLine+@NewLine+"You can review this enquiry record by clicking the doclink icon below.";"";[IncludeDoclink]);

@Prompt([Ok]; "Success"; @Text("Notification sent to selected recipient(s)")); @Command([FileCloseWindow]))



;@If($CopyNotificationToJournal="Record the notification details in the enquiry journal";

@SetField("$hiddenjournal";$hiddenjournal+@NewLine+"["+@Text(@Now;"D0")+ "] "+@Name([CN]; @V3UserName)+" sent the following Notification to "+@Name([CN];$hiddenmailto)+@NewLine+$hiddendeletionrequest);@IsValid)

;@IsValid

Open in new window

0
Comment
Question by:scribla
2 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 28458909
No, the @SetField isn't executed twice, but the string that you generate is twice as long. An implicit @Implode is executed (kind of), so what you have to do is make it explicit.

Suggestion:

@SetField("$hiddenjournal";$hiddenjournal+@NewLine+"["+@Text(@Now;"D0")+ "] "+@Name([CN]; @V3UserName)+" sent the following Notification to "+ @Implode(@Name([CN];$hiddenmailto); ",")+@NewLine+$hiddendeletionrequest)
0
 
LVL 2

Author Closing Comment

by:scribla
ID: 31706590
Fantastic. Many thanks Sjef!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…

600 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