Writing .p programs - Alert Text in BAM

It wont function if you throw it against any table other than the labordtl, check bruces suggestion as well.. make sure your path is correct. That first list should be amended to the table the BAM is against..

Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of r.morton03
Sent: Friday, March 23, 2012 11:10 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Writing .p programs - Alert Text in BAM



Of course its as simple as changing the extension! :)

Ok, I tried to insert this into a BAM as an alert program, but maybe since I screwed something up along the way, I got the error message that the Alert Program is not valid.

--- In vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>, Rob Bucek <rbucek@...> wrote:
>
> For sure notepad, then just change the extension to .p (bet you didn't know notepad had a built in progress compiler did you?). Here is an example of an alert program that looks at data and sends an email.. this example sends an email when someone clocks into a specific indirect labor activity
>
> {ud/GlbAlert.i & TableName = "LaborDtl"}
>
> Define Variable STime As decimal NO-UNDO.
> Define Variable ClockIn as Decimal NO-UNDO.
> Define Variable Active as Logical NO-UNDO.
> Define Variable Email as Character NO-UNDO.
> Assign ClockIn = LaborDtl.ClockInTime.
> Assign Active = LaborDtl.ActiveTrans.
> Find EmpBasic where LaborDtl.Company = EmpBasic.Company and LaborDtl.EmployeeNum = EmpBasic.EmpID no-lock.
> If available EmpBasic Then Do:
> If Active = Yes and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> DEFINE VARIABLE EquipId AS CHARACTER NO-UNDO.
> Assign EquipID = EmpBasic.FirstName.
> Assign Email = EmpBasic.EMailAddress.
> Assign Email-To = "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@...".
> Assign Email-CC = empbasic.EMailAddress.
> Assign Email-Subject = "MACHINE MAINTENANCE ALERT! :~t" + string(LaborDtl.EmployeeNum).
> Assign Email-Text = "The following Machine has been logged for maintenance:~t" + string(LaborDtl.EmployeeNum)
> + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> + "~n~t~t~t~t~t~t~t ClockIn:~t" + string(Time,"HH:MM:SS")
> + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> End.
> Else Do:
> If Active = No and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> Assign ClockIn = LaborDtl.ClockOutTime.
> Assign EquipID = EmpBasic.FirstName.
> Assign Email = EmpBasic.EMailAddress.
> Assign Email-To = "name@..." + ";" + "name@..." + ";" + " name @..." + ";" + " name @..." + ";" + " name @...".
> Assign Email-CC = empbasic.EMailAddress.
> Assign Email-Subject = "MACHINE MAINTENANCE COMPLETE :~t" + string(LaborDtl.EmployeeNum).
> Assign Email-Text = " The following Machine maintenance has been completed:~t" + string(LaborDtl.EmployeeNum)
> + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> + "~n~t~t~t~t~t~t~t ClockOut:~t" + string(Time,"HH:MM:SS")
> + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> End.
> Else Do:
> Assign SendEmail = False.
> End.
> End.
> End.
>
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: cid:1.234354861@...]<http://www.dsmfg.com/>
> (Click the logo to view our site)<http://www.dsmfg.com/>
>
> From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of r.morton03
> Sent: Friday, March 23, 2012 10:28 AM
> To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Writing .p programs - Alert Text in BAM
>
>
>
> Would like an email to contain Receipt Entry information. Such as our quantity, Vendor, Reference field, and Part number. I have the RDD and Report Styles all figured out, auto-print as well. Just need this last bit of information to be included in the email.
>
> I see that I can enter an "Alert Program" into the BAM. Can anyone give me some guidance to some beginner .p writing? Can I use a notepad file then compile some way?
>
> Thanks in advance! I'm on 9.04.507A
>
>
>
> [Non-text portions of this message have been removed]
>



[Non-text portions of this message have been removed]
Would like an email to contain Receipt Entry information. Such as our quantity, Vendor, Reference field, and Part number. I have the RDD and Report Styles all figured out, auto-print as well. Just need this last bit of information to be included in the email.

I see that I can enter an "Alert Program" into the BAM. Can anyone give me some guidance to some beginner .p writing? Can I use a notepad file then compile some way?

Thanks in advance! I'm on 9.04.507A
For sure notepad, then just change the extension to .p (bet you didn't know notepad had a built in progress compiler did you?). Here is an example of an alert program that looks at data and sends an email.. this example sends an email when someone clocks into a specific indirect labor activity

{ud/GlbAlert.i & TableName = "LaborDtl"}

Define Variable STime As decimal NO-UNDO.
Define Variable ClockIn as Decimal NO-UNDO.
Define Variable Active as Logical NO-UNDO.
Define Variable Email as Character NO-UNDO.
Assign ClockIn = LaborDtl.ClockInTime.
Assign Active = LaborDtl.ActiveTrans.
Find EmpBasic where LaborDtl.Company = EmpBasic.Company and LaborDtl.EmployeeNum = EmpBasic.EmpID no-lock.
If available EmpBasic Then Do:
If Active = Yes and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
DEFINE VARIABLE EquipId AS CHARACTER NO-UNDO.
Assign EquipID = EmpBasic.FirstName.
Assign Email = EmpBasic.EMailAddress.
Assign Email-To = "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@...".
Assign Email-CC = empbasic.EMailAddress.
Assign Email-Subject = "MACHINE MAINTENANCE ALERT! :~t" + string(LaborDtl.EmployeeNum).
Assign Email-Text = "The following Machine has been logged for maintenance:~t" + string(LaborDtl.EmployeeNum)
+ "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
+ "~n~t~t~t~t~t~t~t ClockIn:~t" + string(Time,"HH:MM:SS")
+ "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
End.
Else Do:
If Active = No and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
Assign ClockIn = LaborDtl.ClockOutTime.
Assign EquipID = EmpBasic.FirstName.
Assign Email = EmpBasic.EMailAddress.
Assign Email-To = "name@..." + ";" + "name@..." + ";" + " name @..." + ";" + " name @..." + ";" + " name @...".
Assign Email-CC = empbasic.EMailAddress.
Assign Email-Subject = "MACHINE MAINTENANCE COMPLETE :~t" + string(LaborDtl.EmployeeNum).
Assign Email-Text = " The following Machine maintenance has been completed:~t" + string(LaborDtl.EmployeeNum)
+ "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
+ "~n~t~t~t~t~t~t~t ClockOut:~t" + string(Time,"HH:MM:SS")
+ "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
End.
Else Do:
Assign SendEmail = False.
End.
End.
End.


Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of r.morton03
Sent: Friday, March 23, 2012 10:28 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Writing .p programs - Alert Text in BAM



Would like an email to contain Receipt Entry information. Such as our quantity, Vendor, Reference field, and Part number. I have the RDD and Report Styles all figured out, auto-print as well. Just need this last bit of information to be included in the email.

I see that I can enter an "Alert Program" into the BAM. Can anyone give me some guidance to some beginner .p writing? Can I use a notepad file then compile some way?

Thanks in advance! I'm on 9.04.507A



[Non-text portions of this message have been removed]
Of course its as simple as changing the extension! :)

Ok, I tried to insert this into a BAM as an alert program, but maybe since I screwed something up along the way, I got the error message that the Alert Program is not valid.

--- In vantage@yahoogroups.com, Rob Bucek <rbucek@...> wrote:
>
> For sure notepad, then just change the extension to .p (bet you didn't know notepad had a built in progress compiler did you?). Here is an example of an alert program that looks at data and sends an email.. this example sends an email when someone clocks into a specific indirect labor activity
>
> {ud/GlbAlert.i & TableName = "LaborDtl"}
>
> Define Variable STime As decimal NO-UNDO.
> Define Variable ClockIn as Decimal NO-UNDO.
> Define Variable Active as Logical NO-UNDO.
> Define Variable Email as Character NO-UNDO.
> Assign ClockIn = LaborDtl.ClockInTime.
> Assign Active = LaborDtl.ActiveTrans.
> Find EmpBasic where LaborDtl.Company = EmpBasic.Company and LaborDtl.EmployeeNum = EmpBasic.EmpID no-lock.
> If available EmpBasic Then Do:
> If Active = Yes and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> DEFINE VARIABLE EquipId AS CHARACTER NO-UNDO.
> Assign EquipID = EmpBasic.FirstName.
> Assign Email = EmpBasic.EMailAddress.
> Assign Email-To = "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@..." + ";" + "name@...".
> Assign Email-CC = empbasic.EMailAddress.
> Assign Email-Subject = "MACHINE MAINTENANCE ALERT! :~t" + string(LaborDtl.EmployeeNum).
> Assign Email-Text = "The following Machine has been logged for maintenance:~t" + string(LaborDtl.EmployeeNum)
> + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> + "~n~t~t~t~t~t~t~t ClockIn:~t" + string(Time,"HH:MM:SS")
> + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> End.
> Else Do:
> If Active = No and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> Assign ClockIn = LaborDtl.ClockOutTime.
> Assign EquipID = EmpBasic.FirstName.
> Assign Email = EmpBasic.EMailAddress.
> Assign Email-To = "name@..." + ";" + "name@..." + ";" + " name @..." + ";" + " name @..." + ";" + " name @...".
> Assign Email-CC = empbasic.EMailAddress.
> Assign Email-Subject = "MACHINE MAINTENANCE COMPLETE :~t" + string(LaborDtl.EmployeeNum).
> Assign Email-Text = " The following Machine maintenance has been completed:~t" + string(LaborDtl.EmployeeNum)
> + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> + "~n~t~t~t~t~t~t~t ClockOut:~t" + string(Time,"HH:MM:SS")
> + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> End.
> Else Do:
> Assign SendEmail = False.
> End.
> End.
> End.
>
>
> Rob Bucek
> Production Control Manager
> PH: (715) 284-5376 ext 311
> Mobile: (715)896-0590
> FAX: (715)284-4084
> [Description: cid:1.234354861@...]<http://www.dsmfg.com/>
> (Click the logo to view our site)<http://www.dsmfg.com/>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of r.morton03
> Sent: Friday, March 23, 2012 10:28 AM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Writing .p programs - Alert Text in BAM
>
>
>
> Would like an email to contain Receipt Entry information. Such as our quantity, Vendor, Reference field, and Part number. I have the RDD and Report Styles all figured out, auto-print as well. Just need this last bit of information to be included in the email.
>
> I see that I can enter an "Alert Program" into the BAM. Can anyone give me some guidance to some beginner .p writing? Can I use a notepad file then compile some way?
>
> Thanks in advance! I'm on 9.04.507A
>
>
>
> [Non-text portions of this message have been removed]
>
>>I got the error message that the Alert
>>Program is not valid.
Maybe a path issue?
\\servername\epicor\mfgsys803\server\ud\xxxxx.p


--- In vantage@yahoogroups.com, "r.morton03" <r.morton03@...> wrote:
>
> Of course its as simple as changing the extension! :)
>
> Ok, I tried to insert this into a BAM as an alert program, but maybe since I screwed something up along the way, I got the error message that the Alert Program is not valid.
>
> --- In vantage@yahoogroups.com, Rob Bucek <rbucek@> wrote:
> >
> > For sure notepad, then just change the extension to .p (bet you didn't know notepad had a built in progress compiler did you?). Here is an example of an alert program that looks at data and sends an email.. this example sends an email when someone clocks into a specific indirect labor activity
> >
> > {ud/GlbAlert.i & TableName = "LaborDtl"}
> >
> > Define Variable STime As decimal NO-UNDO.
> > Define Variable ClockIn as Decimal NO-UNDO.
> > Define Variable Active as Logical NO-UNDO.
> > Define Variable Email as Character NO-UNDO.
> > Assign ClockIn = LaborDtl.ClockInTime.
> > Assign Active = LaborDtl.ActiveTrans.
> > Find EmpBasic where LaborDtl.Company = EmpBasic.Company and LaborDtl.EmployeeNum = EmpBasic.EmpID no-lock.
> > If available EmpBasic Then Do:
> > If Active = Yes and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> > DEFINE VARIABLE EquipId AS CHARACTER NO-UNDO.
> > Assign EquipID = EmpBasic.FirstName.
> > Assign Email = EmpBasic.EMailAddress.
> > Assign Email-To = "name@" + ";" + "name@" + ";" + "name@" + ";" + "name@" + ";" + "name@".
> > Assign Email-CC = empbasic.EMailAddress.
> > Assign Email-Subject = "MACHINE MAINTENANCE ALERT! :~t" + string(LaborDtl.EmployeeNum).
> > Assign Email-Text = "The following Machine has been logged for maintenance:~t" + string(LaborDtl.EmployeeNum)
> > + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> > + "~n~t~t~t~t~t~t~t ClockIn:~t" + string(Time,"HH:MM:SS")
> > + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> > End.
> > Else Do:
> > If Active = No and EmpBasic.JCDept = "EQUIP" and LaborDtl.IndirectCode = "MNT" Then Do:
> > Assign ClockIn = LaborDtl.ClockOutTime.
> > Assign EquipID = EmpBasic.FirstName.
> > Assign Email = EmpBasic.EMailAddress.
> > Assign Email-To = "name@" + ";" + "name@" + ";" + " name @..." + ";" + " name @..." + ";" + " name @...".
> > Assign Email-CC = empbasic.EMailAddress.
> > Assign Email-Subject = "MACHINE MAINTENANCE COMPLETE :~t" + string(LaborDtl.EmployeeNum).
> > Assign Email-Text = " The following Machine maintenance has been completed:~t" + string(LaborDtl.EmployeeNum)
> > + "~n~t~t~t~t~t~t~tEquipmentID:~t" + string(EquipID) + " (" + string(EmpBasic.LastName) + ")"
> > + "~n~t~t~t~t~t~t~t ClockOut:~t" + string(Time,"HH:MM:SS")
> > + "~n~t~t~t~t~t~t~t Active:~t" + string(Active).
> > End.
> > Else Do:
> > Assign SendEmail = False.
> > End.
> > End.
> > End.
> >
> >
> > Rob Bucek
> > Production Control Manager
> > PH: (715) 284-5376 ext 311
> > Mobile: (715)896-0590
> > FAX: (715)284-4084
> > [Description: cid:1.234354861@]<http://www.dsmfg.com/>
> > (Click the logo to view our site)<http://www.dsmfg.com/>
> >
> > From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of r.morton03
> > Sent: Friday, March 23, 2012 10:28 AM
> > To: vantage@yahoogroups.com
> > Subject: [Vantage] Writing .p programs - Alert Text in BAM
> >
> >
> >
> > Would like an email to contain Receipt Entry information. Such as our quantity, Vendor, Reference field, and Part number. I have the RDD and Report Styles all figured out, auto-print as well. Just need this last bit of information to be included in the email.
> >
> > I see that I can enter an "Alert Program" into the BAM. Can anyone give me some guidance to some beginner .p writing? Can I use a notepad file then compile some way?
> >
> > Thanks in advance! I'm on 9.04.507A
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>