Solved

Lotus Notes form, if NEW want to send a link email messaged to a assigned users

Posted on 2010-11-22
8
555 Views
Last Modified: 2013-12-18
I have a task database. When users submit tasks I want the person that the task is assigned to(a field that is poplulated with a lookup) to get a link doc email message.  I am thinking when the submitting users does a SAVE, and if the doc is NEW that an email is sent... but I do not know how do put that code on the button.
0
Comment
Question by:Monterey
8 Comments
 
LVL 21

Accepted Solution

by:
shuboarder earned 250 total points
ID: 34190009
Hi Monterey,

something like this should do it:

@If(@IsNewDoc;
@Do(
@MailSend(sendTo; copyTo; blindCopyTo; subject; Remark;Body; [IncludeDocLink]);
@Command([FileSave]);
@Command([CloseWindow])
);
@Do(
@Command([FileSave]);
@Command([CloseWindow])
)
)
0
 
LVL 21

Expert Comment

by:shuboarder
ID: 34190033
obviously, you just replace the parameters (sendTo, copyTo etc.) with the names of the fields on your form.

Hope this helps!
0
 
LVL 15

Expert Comment

by:roylong
ID: 34190150
Do you want to send mail when the document is saved?  Is the save executed when the user clicks the button or when the form closes?  e.g. do you have code on the button?

would something like this work?::

@MailSend("user1/domain":"user2/domain";"";"";"A new document has been added to xxxx";"Click on the link to open the new document";"";[IncludeDocLink]);
@PostedCommand([FileSave]);
@PostedCommand([FileCloseWindow])



0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 22

Expert Comment

by:mbonaci
ID: 34190404
And what if the user saves the new document first and then, afterwards, before closing it, decides to submit?
Or if he saves and closes the doc (like a draft) and then opens and submits?

You'll need some kind of flag field (not physical field on the form, only field in the document).
Then, when the doc is first time submitted, change the field to "1". Now you know that the doc is submitted, regardless of users' working habits.

Use something like this for Submit button (there's no need to add isDocSubmitted field to the form):
@If( !isDocSubmitted = "1" ); 
    @Do(
        @MailSend(sendTo; copyTo; blindCopyTo; subject; Remark; Body; [IncludeDocLink]);
        @SetField( "isDocSubmitted "; "1" );
        @Prompt([OK];"Reminder";"E-mail message sent.")
        @Command( [FileSave] );
        @Command( [FileCloseWindow] ) );
    @Do(
        @Command( [FileSave] );
        @Command( [FileCloseWindow] )
    )
)

Open in new window


See here for @MailSend function params:
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_MAILSEND.html
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34195073
An extension to Marko's idea: instead of the isDocSubmitted field use a status field. Many checks and operations tend to get a lot easier when you use such a field.

For example, your task could have the statuses "New" (or ""), "Submitted", "Opened", "Assigned", "Testing", "Complete", "Hold", etc. and the action Save can easily be hidden when status="Complete".
0
 
LVL 31

Assisted Solution

by:qwaletee
qwaletee earned 250 total points
ID: 34196618
Don't forget to save BEFORE sending a doclink. You can't send a doclink to an unsaved document.

Also, in certain situations, creating a doclink will fial if the database does not have a default view. Make sure there's  a default view in the database.
0
 

Author Closing Comment

by:Monterey
ID: 34200105
I put this on my SAVE/Close button
@PostedCommand([FileSave]);
@MailSend(coverage+"/";"";"";"Follow this link to a new Task";"";"This task has been submitted, and is not yet assigned ";[IncludeDoclink]);
@Command([FileCloseWindow])
0
 
LVL 22

Expert Comment

by:mbonaci
ID: 34203962
That will unconditionally send email every time the button is clicked.

So what happened to requirement:

    "...and if the doc is NEW than an email is sent..."

from your initial question?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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