6.10 Global Alerts

can you please email me a copy of it? because the code there
to "include link" doesn't work, i've been asking Epicor how to include
part number. their response to me was "write a .p program". but, not
being a programmer, that seems a little much to ask, especially since
if their own code worked right...but i digress.

i'd be grateful if you would share with me what you wrote.

amy
amyp@...
I'm sure that this has been covered before, so apologies in advance.

How do you get a Global Alert triggered by a BAM (e.g PartRevision.Approved
change) to include details of the item changed?
I know that you can send the .vdl link but I'd also like to include some
database detail in the mail text.

Thanks in advance for your help

Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173
Richard,
It involves writing a progress procedure, affectionately referred to on this
list as a .p.
You then include the .p as the "alert program". and the code will execute
allowing you to include any details you wish (within certain limitations).
.p files are not terribly difficult to write if you have a programming
background and typically if you can build a report builder report, and are
familiar with queries you should be able to muddle your way through even
without programming background. Typically, this group is very helpful with
.p files, myself included, though everything I know is directly from trial
and error, this group, progress help, this group, a boost or two from my
various CAMs over the years and did I mention THIS GROUP.
Anyway, let us know where your skills are, what you are looking for exactly,
and watch for responses.
Good luck,
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Richard Bailey
Sent: Tuesday, September 26, 2006 10:46 AM
To: UserGroup
Subject: [Vantage] 6.10 Global Alerts


I'm sure that this has been covered before, so apologies in advance.

How do you get a Global Alert triggered by a BAM (e.g
PartRevision.Approved
change) to include details of the item changed?
I know that you can send the .vdl link but I'd also like to include some
database detail in the mail text.

Thanks in advance for your help

Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173






[Non-text portions of this message have been removed]
It's supposed to already contain the detail, but it's a known bug,
and for 5 months I have been waiting for a fix as well. There is an
Epicor SCR regarding this, I can get the number for you for your
reference if you wish.

--- In vantage@yahoogroups.com, "Richard Bailey" <rbailey@...> wrote:
>
> I'm sure that this has been covered before, so apologies in advance.
>
> How do you get a Global Alert triggered by a BAM (e.g
PartRevision.Approved
> change) to include details of the item changed?
> I know that you can send the .vdl link but I'd also like to include
some
> database detail in the mail text.
>
> Thanks in advance for your help
>
> Regards,
> Richard
>
> Richard Bailey
> Dudley Industries
> Mailto: rbailey@...
> Tel: +44(0)1253 738311
> Mob: +44(0)7836 550360
> Fax: +44(0)870 7628173
>
Hi Aaron,
Thanks for the reply.
Back in the dark ages I started out programming, so I'm happy enough with
Report Builder, Crystal, Ground Control, ODBC etc.
I can even remember some of my COBOL training!
If some kind soul could point me in the right direction, maybe provide an
example then hopefully I can get up to speed.
Thanks in advance
Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173


-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Aaron Hoyt
Sent: 26 September 2006 16:19
To: vantage@yahoogroups.com
Subject: RE: [Vantage] 6.10 Global Alerts


Richard,
It involves writing a progress procedure, affectionately referred to on
this
list as a .p.
You then include the .p as the "alert program". and the code will execute
allowing you to include any details you wish (within certain limitations).
.p files are not terribly difficult to write if you have a programming
background and typically if you can build a report builder report, and are
familiar with queries you should be able to muddle your way through even
without programming background. Typically, this group is very helpful with
.p files, myself included, though everything I know is directly from trial
and error, this group, progress help, this group, a boost or two from my
various CAMs over the years and did I mention THIS GROUP.
Anyway, let us know where your skills are, what you are looking for
exactly,
and watch for responses.
Good luck,
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Richard Bailey
Sent: Tuesday, September 26, 2006 10:46 AM
To: UserGroup
Subject: [Vantage] 6.10 Global Alerts

I'm sure that this has been covered before, so apologies in advance.

How do you get a Global Alert triggered by a BAM (e.g
PartRevision.Approved
change) to include details of the item changed?
I know that you can send the .vdl link but I'd also like to include some
database detail in the mail text.

Thanks in advance for your help

Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173

[Non-text portions of this message have been removed]






[Non-text portions of this message have been removed]
Richard,

There are some examples in the mfgsys61\ud\Test folder.

This is a simple one for PO approval but it does look up another
table.

/********************************************************************
******
*********************************************************************
******/

{ud/GlbAlert.i &TableName = "POheader"}
DEFINE VARIABLE vtapprovalstatus as Character NO-UNDO.
DEFINE VARIABLE BuyerEmailaddress as Character NO-UNDO.

IF POHeader.ApprovedBy <> "" and POHeader.ApprovalStatus = "A" then
DO:

FIND MFGSYS.PurAgent

WHERE MFGSYS.PurAgent.BuyerID = POheader.BuyerID NO-LOCK NO-ERROR.

BuyerEmailaddress = MFGSYS.PurAgent.EmailAddress.

ASSIGN Email-To = string(BuyerEmailaddress).
ASSIGN Email-Subject = "Purchase Order Approval Gained PO -
" + String(POHeader.PONum).
ASSIGN Email-Text = "PO Approval for "
+ String(POHeader.PONum) + ".~n~n".
END.
ELSE DO:
Return Error.

END.

Return.


--- In vantage@yahoogroups.com, "Richard Bailey" <rbailey@...> wrote:
>
> Hi Aaron,
> Thanks for the reply.
> Back in the dark ages I started out programming, so I'm happy
enough with
> Report Builder, Crystal, Ground Control, ODBC etc.
> I can even remember some of my COBOL training!
> If some kind soul could point me in the right direction, maybe
provide an
> example then hopefully I can get up to speed.
> Thanks in advance
> Regards,
> Richard
>
> Richard Bailey
> Dudley Industries
> Mailto: rbailey@...
> Tel: +44(0)1253 738311
> Mob: +44(0)7836 550360
> Fax: +44(0)870 7628173
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Aaron Hoyt
> Sent: 26 September 2006 16:19
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] 6.10 Global Alerts
>
>
> Richard,
> It involves writing a progress procedure, affectionately
referred to on
> this
> list as a .p.
> You then include the .p as the "alert program". and the code
will execute
> allowing you to include any details you wish (within certain
limitations).
> .p files are not terribly difficult to write if you have a
programming
> background and typically if you can build a report builder
report, and are
> familiar with queries you should be able to muddle your way
through even
> without programming background. Typically, this group is very
helpful with
> .p files, myself included, though everything I know is directly
from trial
> and error, this group, progress help, this group, a boost or two
from my
> various CAMs over the years and did I mention THIS GROUP.
> Anyway, let us know where your skills are, what you are looking
for
> exactly,
> and watch for responses.
> Good luck,
> Aaron Hoyt
> Vantage Plastics
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Richard Bailey
> Sent: Tuesday, September 26, 2006 10:46 AM
> To: UserGroup
> Subject: [Vantage] 6.10 Global Alerts
>
> I'm sure that this has been covered before, so apologies in
advance.
>
> How do you get a Global Alert triggered by a BAM (e.g
> PartRevision.Approved
> change) to include details of the item changed?
> I know that you can send the .vdl link but I'd also like to
include some
> database detail in the mail text.
>
> Thanks in advance for your help
>
> Regards,
> Richard
>
> Richard Bailey
> Dudley Industries
> Mailto: rbailey@...
> Tel: +44(0)1253 738311
> Mob: +44(0)7836 550360
> Fax: +44(0)870 7628173
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Brychan,
Thanks for the example. It got me started and I've managed to create a .p
which generates emails with Part Number and details included.
Thanks for saving me from having to re-invent yet another wheel!
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
brychanwilliams
Sent: 27 September 2006 09:46
To: vantage@yahoogroups.com
Subject: [Vantage] Re: 6.10 Global Alerts


Richard,

There are some examples in the mfgsys61\ud\Test folder.

This is a simple one for PO approval but it does look up another
table.

/********************************************************************
******
*********************************************************************
******/

{ud/GlbAlert.i &TableName = "POheader"}
DEFINE VARIABLE vtapprovalstatus as Character NO-UNDO.
DEFINE VARIABLE BuyerEmailaddress as Character NO-UNDO.

IF POHeader.ApprovedBy <> "" and POHeader.ApprovalStatus = "A" then
DO:

FIND MFGSYS.PurAgent

WHERE MFGSYS.PurAgent.BuyerID = POheader.BuyerID NO-LOCK NO-ERROR.

BuyerEmailaddress = MFGSYS.PurAgent.EmailAddress.

ASSIGN Email-To = string(BuyerEmailaddress).
ASSIGN Email-Subject = "Purchase Order Approval Gained PO -
" + String(POHeader.PONum).
ASSIGN Email-Text = "PO Approval for "
+ String(POHeader.PONum) + ".~n~n".
END.
ELSE DO:
Return Error.

END.

Return.

--- In vantage@yahoogroups.com, "Richard Bailey" <rbailey@...> wrote:
>
> Hi Aaron,
> Thanks for the reply.
> Back in the dark ages I started out programming, so I'm happy
enough with
> Report Builder, Crystal, Ground Control, ODBC etc.
> I can even remember some of my COBOL training!
> If some kind soul could point me in the right direction, maybe
provide an
> example then hopefully I can get up to speed.
> Thanks in advance
> Regards,
> Richard
>
> Richard Bailey
> Dudley Industries
> Mailto: rbailey@...
> Tel: +44(0)1253 738311
> Mob: +44(0)7836 550360
> Fax: +44(0)870 7628173
>
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Aaron Hoyt
> Sent: 26 September 2006 16:19
> To: vantage@yahoogroups.com
> Subject: RE: [Vantage] 6.10 Global Alerts
>
>
> Richard,
> It involves writing a progress procedure, affectionately
referred to on
> this
> list as a .p.
> You then include the .p as the "alert program". and the code
will execute
> allowing you to include any details you wish (within certain
limitations).
> .p files are not terribly difficult to write if you have a
programming
> background and typically if you can build a report builder
report, and are
> familiar with queries you should be able to muddle your way
through even
> without programming background. Typically, this group is very
helpful with
> .p files, myself included, though everything I know is directly
from trial
> and error, this group, progress help, this group, a boost or two
from my
> various CAMs over the years and did I mention THIS GROUP.
> Anyway, let us know where your skills are, what you are looking
for
> exactly,
> and watch for responses.
> Good luck,
> Aaron Hoyt
> Vantage Plastics
>
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Richard Bailey
> Sent: Tuesday, September 26, 2006 10:46 AM
> To: UserGroup
> Subject: [Vantage] 6.10 Global Alerts
>
> I'm sure that this has been covered before, so apologies in
advance.
>
> How do you get a Global Alert triggered by a BAM (e.g
> PartRevision.Approved
> change) to include details of the item changed?
> I know that you can send the .vdl link but I'd also like to
include some
> database detail in the mail text.
>
> Thanks in advance for your help
>
> Regards,
> Richard
>
> Richard Bailey
> Dudley Industries
> Mailto: rbailey@...
> Tel: +44(0)1253 738311
> Mob: +44(0)7836 550360
> Fax: +44(0)870 7628173
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
Ok Richard,
See Attached. I have copied you off list so the attachments make it. This
should give you some Ideas. It is something I used in a previous life at
Hittite Microwave.
I am sending this because it sticks to sending mail as it's purpose. I now
use BAMs for mostly other things. I will also include one that I have
created that just notifies engineering if tool orders are entered.
Please note that you will need to change email address, obviously. I also
recommend a program called ConText for editing. You can add a plug-in to it
for Progress help that give F1 context sensitive help that is a life saver
over anything progress offers. The procedure editor is little more help
than notepad. ConText will also highlight and number lines for progress
making debugging quick and easy.
Some tips, Make sure you store your .p file in the mfgsys/ud directory, and
make sure the include file (GlbAlert.i) is also there. If it's not, ask
tech support where to find it. They will be able to help you out. As with
all global alerts, make sure you have a process server running, and I
recommend, you enter a test address like your own for testing the first few
runs before you let it live.
Also note...Any time you make changes to the .p file the client that
triggers the code (changes the field that results in the BAM event) will
only run the code that is compiled on their local computer since their last
restart of Vantage, therefore, if the execute a BAM and it works, and you
make changes and the execute it again, they will use the same code until
they restart Vantage locally. That being said...typically, I screw it up
enough to kick the user out of Vantage anyway when I get it wrong so this is
only a problem when I am fine tuning, but it can be frustrating when you are
trying to finish and can't figure why your changes aren't making a
difference. Make a habit of restarting the client you are testing with each
change in the code unless your error does it for you :)
That should give you enough to get started.
Beware, the table called out in the initial include statement at the
beginning of the .p must match the table that the BAM uses.
Good luck,
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Richard Bailey
Sent: Wednesday, September 27, 2006 4:02 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] 6.10 Global Alerts


Hi Aaron,
Thanks for the reply.
Back in the dark ages I started out programming, so I'm happy enough with
Report Builder, Crystal, Ground Control, ODBC etc.
I can even remember some of my COBOL training!
If some kind soul could point me in the right direction, maybe provide an
example then hopefully I can get up to speed.
Thanks in advance
Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Aaron Hoyt
Sent: 26 September 2006 16:19
To: vantage@yahoogroups.com
Subject: RE: [Vantage] 6.10 Global Alerts

Richard,
It involves writing a progress procedure, affectionately referred to on
this
list as a .p.
You then include the .p as the "alert program". and the code will execute
allowing you to include any details you wish (within certain limitations).
.p files are not terribly difficult to write if you have a programming
background and typically if you can build a report builder report, and are
familiar with queries you should be able to muddle your way through even
without programming background. Typically, this group is very helpful with
.p files, myself included, though everything I know is directly from trial
and error, this group, progress help, this group, a boost or two from my
various CAMs over the years and did I mention THIS GROUP.
Anyway, let us know where your skills are, what you are looking for
exactly,
and watch for responses.
Good luck,
Aaron Hoyt
Vantage Plastics

-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Richard Bailey
Sent: Tuesday, September 26, 2006 10:46 AM
To: UserGroup
Subject: [Vantage] 6.10 Global Alerts

I'm sure that this has been covered before, so apologies in advance.

How do you get a Global Alert triggered by a BAM (e.g
PartRevision.Approved
change) to include details of the item changed?
I know that you can send the .vdl link but I'd also like to include some
database detail in the mail text.

Thanks in advance for your help

Regards,
Richard

Richard Bailey
Dudley Industries
Mailto: rbailey@...
Tel: +44(0)1253 738311
Mob: +44(0)7836 550360
Fax: +44(0)870 7628173

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





----------

/* BAM-OrderConfirmation.p */
/* Prepared by Aaron Hoyt Rev. 03.24.2004.a */


/* Assign the include file */
{ud/GlbAlert.i &TableName = "Orderhed"}


/* Define the Variables */
DEFINE VARIABLE NewEmailBody AS CHARACTER NO-UNDO.
DEFINE VARIABLE lines AS CHARACTER NO-UNDO.
DEFINE VARIABLE releases AS CHARACTER NO-UNDO.
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE VARIABLE spaces1 AS CHARACTER FORMAT "x(20)" INITIAL "" NO-UNDO.
DEFINE VARIABLE spaces2 AS CHARACTER FORMAT "x(20)" INITIAL "" NO-UNDO.
DEFINE VARIABLE lateship AS CHARACTER FORMAT "x(100)" INITIAL "" NO-UNDO.
DEFINE VARIABLE laterel AS CHARACTER FORMAT "x(5)" INITIAL "" NO-UNDO.
DEFINE VARIABLE repmail AS CHARACTER FORMAT "x(500)" INITIAL "" NO-UNDO.
DEFINE VARIABLE custpart AS CHARACTER FORMAT "x(20)" INITIAL "" NO-UNDO.
DEFINE VARIABLE frommail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-UNDO.
DEFINE VARIABLE shipemail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-UNDO.
DEFINE VARIABLE billemail AS CHARACTER FORMAT "x(100)" INITIAL "" NO-UNDO.
DEFINE VARIABLE custname AS CHARACTER FORMAT "x(100)" INITIAL "" NO-UNDO.
DEFINE VARIABLE sendto AS CHARACTER FORMAT "x(200)" INITIAL "" NO-UNDO.
DEFINE VARIABLE sendcc AS CHARACTER FORMAT "x(200)" INITIAL "" NO-UNDO.
DEFINE VARIABLE repname AS CHARACTER FORMAT "x(200)" INITIAL "" NO-UNDO.
DEFINE VARIABLE custref AS CHARACTER FORMAT "x(200)" INITIAL "" NO-UNDO.


/* If the Order has been released */
IF Orderhed.Date01 > 01/01/2000 and Orderhed.Character02 <> "Brigitte Menning"

THEN DO:
/* Find Table Records associated */

FIND Customer WHERE (Customer.Company = Orderhed.Company) AND
(Customer.custnum = Orderhed.custnum)
NO-LOCK.
FIND UserFile WHERE (UserFile.Name = Orderhed.Character02)
NO-LOCK.


/* Look up the Order details */
For EACH OrderDtl WHERE OrderDtl.Company = Orderhed.Company AND
OrderDtl.OrderNum = Orderhed.OrderNum
BY OrderLine:

/* Reset the releases variable */
releases = "".
/* Find the Release Details for the line */
For EACH OrderRel WHERE OrderRel.Company = OrderDtl.Company AND
OrderRel.OrderNum = OrderDtl.OrderNum AND
OrderRel.OrderLine = OrderDtl.OrderLine
BY OrderRelNum:

/* Assign White space to format the Line Releases */
/* Add up to 7 spaces, subtracting one for each character in the release quantity for the release */
spaces1 = "".
IF LENGTH(string(OrderRel.OurReqQty)) < 7
THEN DO:
DO i = 1 TO 10 - LENGTH(string(OrderRel.OurReqQty)):
spaces1 = spaces1 + " ".
/* End do */
END.
/* End If Length...Then do */
END.
ELSE DO:
spaces1 = " ".
/* End If Length...then...Else do */
END.

/* Add up to 20 spaces, subtracing one for each character in the part number */
spaces2 = "".
DO i = 1 TO 20 - LENGTH(string(OrderRel.PartNum)):
spaces2 = spaces2 + " ".
END.
/* Populate the "lateship" and "laterel" variable if needby is less than Reqdate */
IF OrderRel.NeedByDate < OrderRel.ReqDate
THEN DO:
lateship = "~n* NOTE:" + " ~n NOTE: Hittite's production factory will make every effort to improve the ~"Hittite Ship Date~" to meet your ~"Customer Need Date~".".
laterel = " *".
/* End if lateship...then */
End.
ELSE DO:
lateship = lateship.
laterel = "".
/* End if lateship...then...Else do */
End.

/* Assign the release details to the "releases" variable for use int the "lines" variable for use in the email body */
releases = releases + " ~n" + CAPS(string(OrderRel.PartNum)) + string(spaces2) + string(spaces1) + string(OrderRel.OurReqQty) + " " + string(OrderRel.NeedByDate) + " " + string(OrderRel.ReqDate).

/* End the Order Release Information */
END.

/* Assign the line details to the "lines" variable for use in the email body */
lines = lines + " ~n" + releases.
/* End the Order Line (Detail) information */
END.


/* Populate repmail with the Sales Rep email addresse(s) with seperators */
/* There are 5 posible Reps per order this adds the email address for each of them should they exist*/
DO i = 1 TO 5:

/* Find the Sales rep information based on the specific item of the sales Rep array */
For EACH SalesRep WHERE SalesRep.Company = Orderhed.Company AND SalesRep.SalesRepCode = ENTRY(i,Orderhed.SalesRepList,CHR(126)):
IF SalesRep.EMailAddress <> ""

/* If the Rep exists and has an email address, add a comma and the email address to the variable */
THEN DO:
repmail = repmail + ", " + string(SalesRep.EMailAddress).
repname = repname + ", " + string(SalesRep.Name).

/* End If Rep...then do */
END.
ELSE DO:
repmail = repmail.

/* End If Rep...Then...else do */
END.

/* End For Each Rep */
END.

/* End Do 1 to 5 */
END.

/* Find the Ship To Contact and assign it to the shipemail variable and custname variable */
IF Orderhed.ShpConNum > 0
THEN DO:
FIND CustCnt WHERE (CustCnt.Company = Orderhed.Company) AND
(CustCnt.CustNum = Orderhed.CustNum) AND
(CustCnt.ShipToNum = Orderhed.ShipToNum) AND
(CustCnt.ConNum = Orderhed.ShpConNum)
NO-LOCK.
IF CustCnt.EMailAddress <> ""
THEN DO:
shipemail = string(CustCnt.EMailAddress).
custname = string(CustCnt.Name) + ",".

/* End IF Emailaddress...Then do */
END.
ELSE DO:
shipemail = "".
custname = string(CustCnt.Name) + ",".

/* End IF Emailaddress...Then...Else do */
END.

/* End If ShpConNum...Then do */
END.
ELSE DO:
shipemail = "".
custname = "".

/* End If ShpConNum...Then...Else do */
END.

/* Create the Customer Reference text */
IF LENGTH(string(Orderhed.UserChar1)) > 1
THEN DO:
custref = string(Orderhed.UserChar1).
END.
ELSE DO:
custref = string(Customer.Name).
END.

/* If checkbox04 (VBForm field for don't email this contact) is cleared, find the Bill To Contact
and assign it to the billemail and custname variables overwriting the shipto information as needed */

IF OrderHed.CheckBox04 = False AND Orderhed.PrcConNum > 0
THEN DO:
FIND CustCnt WHERE (CustCnt.Company = Orderhed.Company) AND
(CustCnt.CustNum = Orderhed.CustNum) AND
(CustCnt.ShipToNum = "") AND
(CustCnt.ConNum = Orderhed.PrcConNum)
NO-LOCK.
IF CustCnt.EMailAddress <> ""
THEN DO:
billemail = string(CustCnt.EMailAddress).
custname = string(CustCnt.Name) + ",".

/* End If email address Then do */
END.
ELSE DO:
billemail = "".
custname = string(CustCnt.Name) + ",".

/* End If email...Then...Else do */
END.

/* End If "Don't email this contact" (checkbox04) then do */
END.
ELSE DO:
billemail = "".
custname = custname.

/* End If "Don't email..." then...Else do */
END.



/* Create the from address */

/* If it found a Userfile record, use that address, if not use sales@hittite */
IF LENGTH(string(UserFile.EMailAddress)) > 5
THEN DO:
frommail = string(UserFile.EMailAddress).

/* End if Userfile... then do */
END.
ELSE DO:
frommail = "sales@...".

/* End if userfile...then...else do */
END.

/* if there is at least enough characters in the email address to be one valid email address set up the addresses */
IF LENGTH(string(billemail) + string(shipemail) + string(repmail)) > 5
THEN DO:
IF LENGTH(string(billemail)) > 5
THEN DO:
sendto = string(billemail).
sendcc = string(shipemail) + string(repmail).

/* End if there is a Valid billing email address...then do */
END.
ELSE DO:
sendto = string(shipemail) + string(repmail).
sendcc = "".

/* End if valid billing...then...else do */
END.

/* If the Customer name exists, use it else use the rep name */
IF custname = ""
THEN DO:
custname = string(repname) + ",".

/* End if Customer name...then do */
END.
ELSE DO:
custname = string(custname).

/* End if Customer name...then...else do */
END.

/* Now create the acutal mail */
/**************LIVE***********************************/

ASSIGN Email-From = string(frommail) + ";Hittite Microwave Corporation"
Email-To = string(sendto)
Email-CC = "orders@..., " + string(sendcc)
Email-Subject = "Hittite Microwave Corporation Order Acknowledgement."
Email-Text = "Dear " + string(custname)
+ "~n"
+ "~n" + string(custref) + " Purchase Order " + string(Orderhed.PoNum) + " has been received and processed by Hittite "
+ "and the delivery schedule is below:"
+ " ~n ~n Customer Hittite"
+ "~nPart Qty Need Date Ship Date"
+ string(lines)
+ "~n"
+ "~nThank you for submitting your Purchase Order. Please do not hesitate to contact me if you have any questions about these scheduled deliveries."
+ "~nThe Hittite reference sales order number is " + string(Orderhed.Ordernum) + "."
+ "~n"
+ " ~n**Effective 9/27/04 Hittite Microwave has moved to a new location at:"
+ " ~n20 Alpha Road, Chelmsford, MA 01824"
+ " ~nPlease note that only the street address has changed. All phone/fax numbers, email and remittance addresses have stayed the same."
+ "~n"
+ "~nThank you again,"
+ "~n"
+ "~n" + string(UserFile.Name)
+ "~n" + string(UserFile.EMailAddress)
+ "~nSales Administrator"
+ "~nHittite Microwave Corporation".


/*************TEST********************************************
ASSIGN Email-From = string(frommail) + ";Hittite Microwave Corporation"
Email-To = "hoyt@..."
Email-CC = ""
Email-Subject = "Hittite Microwave Corporation Order Acknowledgement."
Email-Text = "Dear " + string(custname)
+ "~n"
+ "~n" + string(custref) + " Purchase Order " + string(Orderhed.PoNum) + " has been received and processed by Hittite "
+ "and the delivery schedule is below:"
+ " ~n ~n Customer Hittite"
+ "~nPart Qty Need Date Ship Date"
+ string(lines)
+ "~n"
+ "~nThank you for submitting your Purchase Order. Please do not hesitate to contact me if you have any questions about these scheduled deliveries."
+ "~nThe Hittite reference sales order number is " + string(Orderhed.Ordernum) + "."
+ "~n"
+ " ~n**Effective 9/27/04 Hittite Microwave will move to a new location at:"
+ " ~n20 Alpha Road, Chelmsford, MA 01824"
+ " ~nPlease note that only the street address will change. All phone/fax numbers, email and remittance addresses will stay the same."
+ "~n"
+ "~nThank you again,"
+ "~n"
+ "~n" + string(UserFile.Name)
+ "~n" + string(UserFile.EMailAddress)
+ "~nSales Administrator"
+ "~nHittite Microwave Corporation"
+ "~n ~nTo: " + string(sendto)
+ "~nCC: " + string(sendcc).
**************TEST********************************************/

END.
/* If there is not enough characters for a valid email address */
ELSE DO:
RETURN "CANCEL SEND":U.
END.

END.
/* If the order release date is not 2000 or above. */
ELSE DO:
RETURN "CANCEL SEND":U.
END.

----------

/* ToolOrderEntered.p */
/* Prepared by Aaron Hoyt Rev. 04.12.2005.a */

/* Include file for access to global alerts */
{ud/GlbAlert.i &tablename = "OrderDtl" }

/* Define Variables */
DEFINE VARIABLE pn AS CHARACTER INITIAL "TL,PT" NO-UNDO.

/* If the Order Line is for Tooling or Prototype */
IF LOOKUP (SUBSTRING(OrderDtl.PartNum,1,2,"CHARACTER"), pn) > 0
THEN DO:

/* Create an email */
ASSIGN Email-To = "craig.steele@..."
Email-CC = "aaron.hoyt@..., paul.aultman@..."
Email-Subject = "Tooling Order " + string(OrderDtl.OrderNum) + " has been entered."
Email-Text = "Sales order "
+ string(OrderDtl.OrderNum)
+ " has been entered into the system for " + string(OrderDtl.PartNum) + "."
+ " ~n~n"
+ "The expected job number would be "
+ "00" + string(OrderDtl.OrderNum) + "-" + string(OrderDtl.OrderLine) + "-1.".

END.

/* If the Order is not for Tooling or Prototype cancel the email */
ELSE DO:
Return "Cancel Send":U.
END.


[Non-text portions of this message have been removed]