Sage MAS 90 and 200 Sage MAS 500 blogs Product Feedback Support Training
Reply
Sage MAS 90 Customer
bridgette
Posts: 23
Registered: 04-19-2010
0

Sales Order Entry - Email Confirmation

[ Edited ]

Good morning!

 

I'm using MAS 90 4.3 - I was wondering if there's a way within paperless office or someplace that I can setup email confirmation to the customer when a sales order is created.  Or is this yet another custom solution?

Thanks.

Switcher
BigLouie
Posts: 2,689
Registered: 10-28-2008
0

Re: Sales Order Entry - Email Confirmation

We use two methods. For our service orders we use Knowledge Sync to send an email to our customers. We also have a script on a button that allows the order writer to send it out with the click of a button.  Here is the code. It came from the Obe Wan of MAS, Slade.

 

' Slade Hornick
' Hornick Consulting www.hornickconsulting.com
' Original 01/29/2004
' Example VBScript for emailing  order information from S/O Entry

Function FormatOrder(TheString)
    If Len(TheString) >= 7 Then
       FormatOrder = TheString
    Else
       FormatOrder = String(7-Len(TheString),"0")& TheString
    End If
End Function


' Setup the connection to the ODBC Driver and login
' ********
' Need to change the user to one on your system
' ********


If MAS_SCR_CMP = "SAF" then
strConnectionString = "DSN=SOTAMAS90;UID=Louis|SAF;PWD=target"

Else

If MAS_SCR_CMP = "ICP" then 
strConnectionString = "DSN=SOTAMAS90;UID=Louis|ICP;PWD=target"
End If

End If

Set Connection = CreateObject("ADODB.Connection")
Connection.Open strConnectionString
Set rsOrder = CreateObject("ADODB.Recordset")
Set rsItems = CreateObject("ADODB.Recordset")

SO_SalesOrder_bus_SalesOrderNo = FormatOrder(SO_SalesOrder_bus_SalesOrderNo)

'
' *********HEADER INFORMATION*********
' Select the header record and build part of the email body
Sql_Order = "Select * from SO_SalesOrderHeader where SalesOrderNo ='" & SO_SalesOrder_bus_SalesOrderNo & "'"
rsOrder.Open Sql_Order, Connection

txtbody="Dear: " &SO_SalesOrder_bus_ConfirmTo &vbCRLF&vbCRLF&_
"we have received your order and it is currently being processed for shipping." &vbCRLF&vbCRLF&_
"Order No: "&SO_SalesOrder_bus_SalesOrderNo&vbCRLF&_
"PO Number: "&SO_SalesOrder_bus_CustomerPONo&vbCRLF&vbCRLF&_
"Qty"&Space(3)&"Item Number"&Space(18)&"Description"&Space(37)&"Price"&vbCRLF&_
"---- ---------------------------------------------------------------------------------"&vbCRLF
'
' *********DETAIL INFORMATION*********
' Select the order line records and build part of the email body
Sql_Items = "Select * from SO_SalesOrderDetail where SalesOrderNo='" & SO_SalesOrder_bus_SalesOrderNo & "' AND ItemType='1'"
rsItems.Open Sql_Items, Connection
Do While Not rsItems.EOF
'msg=rsItems("ItemCode")
'msgbox msg
txtbody=txtbody&rsItems.Fields.Item("QuantityOrdered").Value&String(5-Len(rsItems.Fields.Item("QuantityOrdered").Value)," ")&" "&_
rsItems.Fields.Item("ItemCode").value&String(15-Len(rsItems.Fields.Item("ItemCode").value)," ")&Space(23-Len(rsItems("ItemCode")))&_
rsItems.Fields.Item("ItemCodeDesc").value&String(30-Len(rsItems.Fields.Item("ItemCodeDesc").value)," ")&Space(36-Len(TRIM(rsItems("ItemCodeDesc"))))&" "&_
FormatNumber(rsItems.Fields.Item("ExtensionAmt").value)&vbCRLF
rsItems.MoveNext
Loop

SubTotal=SO_SalesOrder_bus_TaxableAmt+SO_SalesOrder_bus_NonTaxableAmt

txtBody=txtBody&_
"=========================================================================="&vbCRLF&_
Space(50)&"Sub-Total"&Space(7)&FormatNumber(SubTotal,2)&vbCRLF&_
Space(50)&"Shipping"&Space(8)&FormatNumber(SO_SalesOrder_bus_FreightAmt)&vbCRLF&_
Space(50)&"Sales Tax"&Space(7)&FormatNumber(SO_SalesOrder_bus_SalesTaxAmt)&vbCRLF&_
Space(50)&"Grand Total"&Space(5)&FormatCurrency(SO_SalesOrder_bus_SalesTaxAmt+SO_SalesOrder_bus_FreightAmt+SO_SalesOrder_bus_NonTaxableAmt+SO_SalesOrder_bus_TaxableAmt)&vbCRLF&vbCRLF&_
"Thanks for your business."&vbCRLF&_
"If you have any questions about your order, you can contact your sales rep at 800-880-8855"&vbCRLF&_
"Safety Vision"


Set rsItems = Nothing
Set rsOrder = Nothing
Set Connection = Nothing

' Create Email
On Error Resume Next

Dim objOutlook
Dim objNameSpace

Dim mItem

Dim strReceipient
Dim strSubject
Dim strBodyText
Dim strMsg

Const olMailItem = 0

    strMsg = "Enter Receipient Mail Address." & vbCrLf & "(Format:  email@safetyvision.com)"
    strReceipent = InputBox(strMsg, "Send To:", "")

    strSubject = "Order Number: "&SO_SalesOrder_bus_SalesOrderNo

    strBodyText = txtBody

    Set objOutlook = CreateObject("Outlook.application")
    Set objNameSpace = objOutlook.GetNamespace("MAPI")
    Set mItem = objOutlook.CreateItem(olMailItem)

    
    mItem.To = strReceipent
    mItem.Subject = strSubject
    mItem.Body = strBodyText

    mItem.Save
    mItem.Send
 



' ****  Clean up
'
    Set mItem = Nothing
    Set objNameSpace = Nothing
    set objOutlook = Nothing

 

Big Louie No MBA but BMOC
--------------------------------------------------------------------------
You have enemies? Good. That means you've stood up for something in your life.
Super Contributor
Heather
Posts: 798
Registered: 10-29-2008
0

Re: Sales Order Entry - Email Confirmation


bridgette wrote:

Good morning!

 

I'm using MAS 90 4.3 - I was wondering if there's a way within paperless office or someplace that I can setup email confirmation to the customer when a sales order is created.  Or is this yet another custom solution?

Thanks.


You can set up paperless office to send e-mails when you print the sales order.

Switcher
BigLouie
Posts: 2,689
Registered: 10-28-2008
0

Re: Sales Order Entry - Email Confirmation


Heather wrote:
 

You can set up paperless office to send e-mails when you print the sales order.


Just remembered I left out that option.

Big Louie No MBA but BMOC
--------------------------------------------------------------------------
You have enemies? Good. That means you've stood up for something in your life.