Hi guys,
I was asked if it would be possible that "once a support record is closed an email is sent to the saleperson responsible for the customer the incident is related to without any user intervention"
This is only in the 'could this be done' stage.
So does anyone know if this would be at all possible? I think I know that an email can be created from within Attain, but I am not sure if this can be done 'without user intervention'.
Or does someone know of a 'plug in' that already does this?
Cheers
Jim
Give a man a fish and he will eat for a day, teach a man to fish and he will drink beer allday.
0
Comments
without a doubt this can be done, and I say this as I wrote the same thing on our internal support system about 3 weeks ago.
I triggered mine when a support call reached a particular status code which then went back to the customer card and checked for various details. Try codeunit 396 - Mail. This uses simple MAPI and works well.
Only problem may be the amount of detail you want to send, but I bypassed this issue by creating a report and attaching this to the email(HTML or preferably PDF if you can).
Dean.
I take it that the mail was sent without user intervention?
I'm using commail for a similar demans ant that works very well.
Disadvantage is that you need to do a DOS call with the SYSTEM command.
I know about an SMTP-OCX which should do similar, but I've got no experience with this.
Yes.
Basically set the following parameter:
OpenDialog:=TRUE;//opens the pop-up window
OpenDialog:=FALSE;//sends without the window.
Bear in mind your version of Outlook as XP and 2003 has a security feature that stops the mail being sent without allowing Navision access to email and blocks certain attachments on the mails. But don't worry too much, there is an adminstrator form that can be applied in Exchange that bypasses this on http://www.slipstick.com
Dean
btw: use the "newmailmessage" function from the codeunit 397
The posts have been extremly useful.
Now that I know others have achieved this I can discuss the actual spec with those that have asked for this.
No doubt I will be posting back again some point in the future about this
Imho, it's enhough to call the functions "newmail".
If it was hard to write, it should be hard to understand."
This particular client wanted email notifications both internal and external for a variety of business events. I created a series of functions in a single codeunit that were specialized to each event (basically the text of the message changed). Then, in the code that determines (in your example) that a support record is closed, you add a one-line function call of:
Emailcodeunit.SendmessageToSalesperson(Salespersonemail address, SupportRecordId);
Then in the EmailCodeunit, you can format the message and send it. Here's a snippet of code that uses the ANSMTP OCX:
IF CREATE(ansmtp) THEN; // need to "instantiate" smtp
ansmtp.ServerAddr(<Email SMTP Server Address>);
ansmtp.UserName(<Email SMTP User Name>);
ansmtp.Password(<Email SMTP User Password>);
ansmtp.From('Navision Automated Notice');
ansmtp.FromAddr('Navision_notice@Navision.com');
ansmtp.RegisterKey(<ANSMTP unlocking Serial Number goes here>);
ansmtp.Subject('Customer Support issue closed');
BodyText := BodyText + 'Customer Support Issue ' + SupportRecordID + ' for customer ' + CustNo + ' has been closed.'
ansmtp.AppendBody(BodyText,0);
ansmtp.AddRecipient(Salespersonemailaddress, 0);
IF NOT (ansmtp.SendMail() = 0) THEN
MESSAGE('There was an error during the sending of email on closed support incident ' + SupportRecordID' + '. Please notify the Computer Department. Error was '+ ansmtp.GetLastErrDescription());
We've done a lot of things that make the creation of the message body easier, like storing the message body text in a "template" record so it can easily be edited, but I think you get the idea that once you create one message, it's easy to create additional messages for different events.
The ANSMTP OCX control is available at www.emailarchitect.net, and their email support is very good.
RIS Plus, LLC