Monterey
asked on
Lotus Notes form, if NEW want to send a link email messaged to a assigned users
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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/doma in";"";""; "A new document has been added to xxxx";"Click on the link to open the new document";"";[IncludeDocLi nk]);
@PostedCommand([FileSave]) ;
@PostedCommand([FileCloseW indow])
would something like this work?::
@MailSend("user1/domain":"
@PostedCommand([FileSave])
@PostedCommand([FileCloseW
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):
See here for @MailSend function params:
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_MAILSEND.html
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] )
)
)
See here for @MailSend function params:
http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.designer.domino.main.doc/H_MAILSEND.html
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".
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".
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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] )
@PostedCommand([FileSave])
@MailSend(coverage+"/";"";
@Command([FileCloseWindow]
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?
So what happened to requirement:
"...and if the doc is NEW than an email is sent..."
from your initial question?
Hope this helps!