BAM alerts sending old data information

Patrick,
It looks like you are doing everything correctly, so...
How about you give a shot with the USERID function. It may or may not work,
but it's worth a shot.
Give a shot including something like "Changed by " string(USERID) ".".
Let us know if it accomplishes what you are looking for.
Best of luck,
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Patrick Parker
Sent: Friday, February 15, 2008 10:55 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BAM alerts sending old data information


Aha! I threw in a few more fields to test and the rest are working
properly with the <variable> and OLD<variable> methodology. The only
field that doesn't work properly is the ChangedBy field, which
returns the old data before database modification for both values.
It doesn't appear that I'm able to get the value of who is currently
changing the record. (This is a BAM .p file)

Here's the basic code (there's duplicate fields everywhere for my
debugging tests). The BAM is set up on the Customer table with
selected fields of CreditHold and CreditLimit and the alert program
to the below. The two ChangedBy fields below always return the same
value - that of what was in the database prior to the change.

/***********
include Global Alert file - Customer table was selected in BAM
*************/
{ud/GlbAlert.i &TableName = "Customer"}

/**************
test to see if the new customer record was completed.
**************/
IF Customer.Name = "" THEN DO:
RETURN "Cancel Send":U.
END.

ASSIGN Email-From = "vantage-test@...".
ASSIGN Email-To = "pparker@...".

IF Customer.ChangedBy <> "" THEN DO:
IF Customer.CreditHold THEN DO:
ASSIGN Email-Subject = "TEST: Customer Placed on Credit Hold".
ASSIGN Email-Text = "Customer """ + Customer.Name
+ """ has been placed on credit hold by " + Customer.ChangedBy
+ OLDCustomer.ChangedBy + string(Customer.CreditLimit) +
string(OLDCustomer.CreditLimit) + ".".
END.
ELSE DO:
ASSIGN Email-Subject = "TEST: Customer Taken off Credit Hold".
ASSIGN Email-Text = "Customer """ + Customer.Name
+ """ has been taken off credit hold by " + Customer.ChangedBy
+ OLDCustomer.ChangedBy + string(Customer.CreditLimit) +
string(OLDCustomer.CreditLimit) + ".".
END.
END.

--- In vantage@yahoogroups.com, "Aaron Hoyt" <aaron.hoyt@...> wrote:
>
> You are correct, BAM is 4GL. As for a reference guide, there are
guides
> available from Progress.
> The next question is...do you really need the (I think 400 page)
guide? I
> believe for the most part the answer is no when it comes to just
creating
> BAM alerts. You will find the progress help a huge resource with
examples.
> I love to use ConText to edit the .p files as it highlights the
language to
> make it easier to see mistakes and such. It also can be configured
> relatively easily to enable context sensitive help with the F1 key.
> Therefore you can be typing a function and press F1 to get
explanations and
> examples of code that are specific to what you are doing.
> That being said...the function you are looking for is string
(numeric value).
> This will convert "numeric value" into a text value or numbers as
text.
> The bigger problem is the triggering of your BAM before the record
update
> has been finalized. Are you sure you are using a BAM and not a BPM
to
> trigger the alert. BPMs can be configured to run before or after
updates to
> the dataset, but a true BAM should run after the actual database
record has
> been finalized and is ready to be written. This concerns me
greatly that
> you are getting BAMs that trigger before the record is finalized
completely.
> Would you mind posting the code you have written with an
explanation of the
> fields that are selected to trigger the BAM? I would be very
interested in
> looking over what you have done to see if there might be a reason
for the
> inconsistent results.
> Best of luck,
> Aaron Hoyt
> Vantage Plastics
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Patrick Parker
> Sent: Thursday, February 14, 2008 4:02 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: BAM alerts sending old data information
>
>
> The BAM applications don't execute VB I don't believe (am I wrong
on
> this?). I believe they're executing a 4GL language correct? Does
> anyone have a language reference for programming these? I was
trying
> to figure out how to convert a numeric variable to text to return
in
> an alert.
>
>
> Recent Activity
> a.. 4New Members
> Visit Your Group
> Yahoo! Finance
> It's Now Personal
>
> Guides, news,
>
> advice & more.
>
> Search Ads
> Get new customers.
>
> List your web site
>
> in Yahoo! Search.
>
> Yahoo! Groups
> Cat Zone
>
> Connect w/ others
>
> who love cats.
> .
>
>
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
I've set up a BAM to run my own program that sends email whenever
someone toggles a Customer's credit hold to off. (I tried to use a BPM
initially but couldn't find the method that would trigger on CreditHold
toggling even though some look like they would do that).

Anyways, the emails from the program are sending data that was in the
table BEFORE the update. Example is if I use Customer.ChangedBy as a
variable in the program, it's either blank for new records being
created, or the value that was in the table before someone changes it.

At the beginning of my program I'm declaring:
{ud/GlbAlert.i &TableName = "Customer"}

I would have figured had I put "OLDCustomer" I would be getting the old
data, but still I get it this way. Anyone have any idea on where I'm
going wrong here?
Seems to me setting up an appropriate audit/change log for the data would be a better solution on such (for most manufacturers) rarely edited data. (The resulting add'l system load overhead would be manageable.) I know 8.03 supports this but have no idea about previous releases.

Rob Brown



Patrick <pbparker@...> wrote:
I've set up a BAM to run my own program that sends email whenever
someone toggles a Customer's credit hold to off. (I tried to use a BPM
initially but couldn't find the method that would trigger on CreditHold
toggling even though some look like they would do that).

Anyways, the emails from the program are sending data that was in the
table BEFORE the update. Example is if I use Customer.ChangedBy as a
variable in the program, it's either blank for new records being
created, or the value that was in the table before someone changes it.

At the beginning of my program I'm declaring:
{ud/GlbAlert.i &TableName = "Customer"}

I would have figured had I put "OLDCustomer" I would be getting the old
data, but still I get it this way. Anyone have any idea on where I'm
going wrong here?






---------------------------------
Never miss a thing. Make Yahoo your homepage.

[Non-text portions of this message have been removed]
Dangit, I keep forgetting to state my version, I'm using 8.03.

The need for the emails is we allow sales people to create customers
so they can create quotes on the fly, however we don't want them
modifying credit limits or removing them from credit hold without
reason. We want emails sent to the financial people just to let them
know when someone has toggled a credit hold for a customer, that way
they know when someone has turned it off or modified the limit that's
not from finance.

Problem is I'm not getting consistent data from the BAM program
variables. If I create a new customer, Customer.Name sends the newly
created properly, howver Customer.ChangedBy sends a blank.

If I update a customer record, Customer.ChangedBy is sent with
whoever changed it last, so it's like it's sending the data from the
database before the update.


--- In vantage@yahoogroups.com, Robert Brown <robertb_versa@...>
wrote:
>
> Seems to me setting up an appropriate audit/change log for the
data would be a better solution on such (for most manufacturers)
rarely edited data. (The resulting add'l system load overhead would
be manageable.) I know 8.03 supports this but have no idea about
previous releases.
>
> Rob Brown
>
>
>
> Patrick <pbparker@...> wrote:
> I've set up a BAM to run my own program that sends email
whenever
> someone toggles a Customer's credit hold to off. (I tried to use a
BPM
> initially but couldn't find the method that would trigger on
CreditHold
> toggling even though some look like they would do that).
>
> Anyways, the emails from the program are sending data that was in
the
> table BEFORE the update. Example is if I use Customer.ChangedBy as
a
> variable in the program, it's either blank for new records being
> created, or the value that was in the table before someone changes
it.
>
> At the beginning of my program I'm declaring:
> {ud/GlbAlert.i &TableName = "Customer"}
>
> I would have figured had I put "OLDCustomer" I would be getting the
old
> data, but still I get it this way. Anyone have any idea on where
I'm
> going wrong here?
>
>
>
>
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
>
> [Non-text portions of this message have been removed]
>
Hi
I have just been doing this in 6.1
I gues it the same ish in 8.x
Leave the Top of the file as
> > At the beginning of my program I'm declaring:
> > {ud/GlbAlert.i &TableName = "Customer"}

When you get your current data use some thing like
xyz = string9Mfgsys.OrderRel.OurReqQty)
to get the old data that has been overwritten use

oldXYZ = string(Mfgsys.OLDOrderRel.OurReqQty)

in your example OrderRel.OurRelQty goes to customer.FieldName
and

No need to link or define OLD table name
hope this help

Dave
There is a pre-written alert already in Vista specifically for changes
in credit hold status. Is there a reason you don't want to implement
that one?


Kersten MacLennan
IT/ERP Analyst
Semrock, Inc.
3625 Buffalo Rd.,
Suite 6
Rochester, NY 14624
585-594-7009
585-594-7095 fax

kmaclennan@...

The Standard in Optical Filters for Biotech & Analytical Instrumentation


Hundreds of Thousands of Ion Beam Sputtered filters delivered -
extensive inventory now!

The information contained in this message and any attachments may be
privileged, confidential, and protected from disclosure. If the reader
of this message is not the intended recipient, or any agent responsible
for delivering this message to the intended recipient, you are hereby
notified that any dissemination, distribution, or copying of this
communication may be unlawful and therefore strictly prohibited. If you
received this message in error, please reply to the message and delete
it. Thank you




________________________________

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Patrick
Sent: Tuesday, February 05, 2008 6:12 PM
To: vantage@yahoogroups.com
Subject: [Vantage] BAM alerts sending old data information



I've set up a BAM to run my own program that sends email whenever
someone toggles a Customer's credit hold to off. (I tried to use a BPM
initially but couldn't find the method that would trigger on CreditHold
toggling even though some look like they would do that).

Anyways, the emails from the program are sending data that was in the
table BEFORE the update. Example is if I use Customer.ChangedBy as a
variable in the program, it's either blank for new records being
created, or the value that was in the table before someone changes it.

At the beginning of my program I'm declaring:
{ud/GlbAlert.i &TableName = "Customer"}

I would have figured had I put "OLDCustomer" I would be getting the old
data, but still I get it this way. Anyone have any idea on where I'm
going wrong here?






[Non-text portions of this message have been removed]
You can customize Customer Entry in Vantage 8.x, make the
Billing\Credit tab invisible, and update everyone's reference to
Customer Entry with the customization except Accounts Receivable. Now
only Accounting can update the Credit info.

--- In vantage@yahoogroups.com, "Patrick" <pbparker@...> wrote:
>
> Dangit, I keep forgetting to state my version, I'm using 8.03.
>
> The need for the emails is we allow sales people to create
customers
> so they can create quotes on the fly, however we don't want them
> modifying credit limits or removing them from credit hold without
> reason. We want emails sent to the financial people just to let
them
> know when someone has toggled a credit hold for a customer, that
way
> they know when someone has turned it off or modified the limit
that's
> not from finance.
>
> Problem is I'm not getting consistent data from the BAM program
> variables. If I create a new customer, Customer.Name sends the
newly
> created properly, howver Customer.ChangedBy sends a blank.
>
> If I update a customer record, Customer.ChangedBy is sent with
> whoever changed it last, so it's like it's sending the data from
the
> database before the update.
>
>
> --- In vantage@yahoogroups.com, Robert Brown <robertb_versa@>
> wrote:
> >
> > Seems to me setting up an appropriate audit/change log for the
> data would be a better solution on such (for most manufacturers)
> rarely edited data. (The resulting add'l system load overhead would
> be manageable.) I know 8.03 supports this but have no idea about
> previous releases.
> >
> > Rob Brown
> >
> >
> >
> > Patrick <pbparker@> wrote:
> > I've set up a BAM to run my own program that sends
email
> whenever
> > someone toggles a Customer's credit hold to off. (I tried to use
a
> BPM
> > initially but couldn't find the method that would trigger on
> CreditHold
> > toggling even though some look like they would do that).
> >
> > Anyways, the emails from the program are sending data that was in
> the
> > table BEFORE the update. Example is if I use Customer.ChangedBy
as
> a
> > variable in the program, it's either blank for new records being
> > created, or the value that was in the table before someone
changes
> it.
> >
> > At the beginning of my program I'm declaring:
> > {ud/GlbAlert.i &TableName = "Customer"}
> >
> > I would have figured had I put "OLDCustomer" I would be getting
the
> old
> > data, but still I get it this way. Anyone have any idea on where
> I'm
> > going wrong here?
The pre-canned alert doesn't say who made the change nor does it
indicate if the customer is new or an existing one. I wanted my
custom alert to give a little better information to finance.

Either way, not sure I'm going to be able to accomplish what I need.


--- In vantage@yahoogroups.com, "Kersten MacLennan" <kmaclennan@...>
wrote:
>
> There is a pre-written alert already in Vista specifically for
changes
> in credit hold status. Is there a reason you don't want to implement
> that one?
>
>
> Kersten MacLennan
> IT/ERP Analyst
> Semrock, Inc.
> 3625 Buffalo Rd.,
> Suite 6
> Rochester, NY 14624
> 585-594-7009
> 585-594-7095 fax
>
> kmaclennan@...
>
> The Standard in Optical Filters for Biotech & Analytical
Instrumentation
>
>
> Hundreds of Thousands of Ion Beam Sputtered filters delivered -
> extensive inventory now!
>
> The information contained in this message and any attachments may be
> privileged, confidential, and protected from disclosure. If the
reader
> of this message is not the intended recipient, or any agent
responsible
> for delivering this message to the intended recipient, you are
hereby
> notified that any dissemination, distribution, or copying of this
> communication may be unlawful and therefore strictly prohibited. If
you
> received this message in error, please reply to the message and
delete
> it. Thank you
>
>
>
>
> ________________________________
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On
Behalf
> Of Patrick
> Sent: Tuesday, February 05, 2008 6:12 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] BAM alerts sending old data information
>
>
>
> I've set up a BAM to run my own program that sends email whenever
> someone toggles a Customer's credit hold to off. (I tried to use a
BPM
> initially but couldn't find the method that would trigger on
CreditHold
> toggling even though some look like they would do that).
>
> Anyways, the emails from the program are sending data that was in
the
> table BEFORE the update. Example is if I use Customer.ChangedBy as
a
> variable in the program, it's either blank for new records being
> created, or the value that was in the table before someone changes
it.
>
> At the beginning of my program I'm declaring:
> {ud/GlbAlert.i &TableName = "Customer"}
>
> I would have figured had I put "OLDCustomer" I would be getting the
old
> data, but still I get it this way. Anyone have any idea on where
I'm
> going wrong here?
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
> > Anyways, the emails from the program are sending data that was in
> the
> > table BEFORE the update. Example is if I use Customer.ChangedBy
as
> a
> > variable in the program, it's either blank for new records being
> > created, or the value that was in the table before someone
changes
> it.
i was having the same kind of trouble doing a change BAM for order
dates.

Keep {ud/GlbAlert.i &TableName = "Customer"}

You need to add lines that drops the mail if Change by is null

DEFINE VARIABLE OldChBy AS CHARACTER NO-UNDO.
OldChBy = string(Mfgsys.OLDcustomer.ChangedBy).
IF OldChBy = "" THEN RETURN "CANCEL SEND".


this should filter out Newly added sustomers
then
oldCustomer.CreditHold Gives the Original setting and
Customer.CreditHold Gives the New Setting.

I had to add a few Cancel Sends to stop New Items from generating
mails
but you will only tell that by testing.
I found the confusing thing was some times it sent 2 or 3 mails for
one addition / change
and they would arrive in my mail box in the wrong order.
until i sorted the mail box by sent time rather than recieved time.
then they made more sence.


Dave
You can customize Customer Entry, make the Billing\Credit tab invisible, and update everyone's reference to Customer Entry with the customization except Accounts Receivable. Now only Accounting can update the Credit info.

----- Original Message -----
From: "Patrick" <pbparker@...>
To: <vantage@yahoogroups.com>
Sent: Tuesday, February 05, 2008 3:33 PM
Subject: [Vantage] Re: BAM alerts sending old data information


Dangit, I keep forgetting to state my version, I'm using 8.03.

The need for the emails is we allow sales people to create customers
so they can create quotes on the fly, however we don't want them
modifying credit limits or removing them from credit hold without
reason. We want emails sent to the financial people just to let them
know when someone has toggled a credit hold for a customer, that way
they know when someone has turned it off or modified the limit that's
not from finance.

Problem is I'm not getting consistent data from the BAM program
variables. If I create a new customer, Customer.Name sends the newly
created properly, howver Customer.ChangedBy sends a blank.

If I update a customer record, Customer.ChangedBy is sent with
whoever changed it last, so it's like it's sending the data from the
database before the update.


[Non-text portions of this message have been removed]
I get it... The BAM captures the values before the adapter is called to update the record to the entered new values.

I have ZERO experience with it, but your need sounds very much like what Epicor sales claims auditing can do (and is intended for).

That said, little in 8.03 acts as nicely as the sales scripts portrayed.

It would probably be a pain to code, but you could do an app customization that is triggered by appropriate before event(s), captures the original data in appropriate temp variables or an array, and then uses appropriate after change event(s) to capture the new values (and who made the change, etc.,) - finally firing off a barebones email to an email group account named for the role of the group of people that do this checking of changes.

The email send portion would likely be the 'painful' portion to code (at least it would be for me) - assuming this decapitated, customized version of VB supplied with 8.03 even supports it.

Rob Brown



Patrick <pbparker@...> wrote:
Dangit, I keep forgetting to state my version, I'm using 8.03.

The need for the emails is we allow sales people to create customers
so they can create quotes on the fly, however we don't want them
modifying credit limits or removing them from credit hold without
reason. We want emails sent to the financial people just to let them
know when someone has toggled a credit hold for a customer, that way
they know when someone has turned it off or modified the limit that's
not from finance.

Problem is I'm not getting consistent data from the BAM program
variables. If I create a new customer, Customer.Name sends the newly
created properly, howver Customer.ChangedBy sends a blank.

If I update a customer record, Customer.ChangedBy is sent with
whoever changed it last, so it's like it's sending the data from the
database before the update.

--- In vantage@yahoogroups.com, Robert Brown <robertb_versa@...>
wrote:
>
> Seems to me setting up an appropriate audit/change log for the
data would be a better solution on such (for most manufacturers)
rarely edited data. (The resulting add'l system load overhead would
be manageable.) I know 8.03 supports this but have no idea about
previous releases.
>
> Rob Brown
>
>
>
> Patrick <pbparker@...> wrote:
> I've set up a BAM to run my own program that sends email
whenever
> someone toggles a Customer's credit hold to off. (I tried to use a
BPM
> initially but couldn't find the method that would trigger on
CreditHold
> toggling even though some look like they would do that).
>
> Anyways, the emails from the program are sending data that was in
the
> table BEFORE the update. Example is if I use Customer.ChangedBy as
a
> variable in the program, it's either blank for new records being
> created, or the value that was in the table before someone changes
it.
>
> At the beginning of my program I'm declaring:
> {ud/GlbAlert.i &TableName = "Customer"}
>
> I would have figured had I put "OLDCustomer" I would be getting the
old
> data, but still I get it this way. Anyone have any idea on where
I'm
> going wrong here?
>
>
>
>
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
>
> [Non-text portions of this message have been removed]
>






---------------------------------
Never miss a thing. Make Yahoo your homepage.

[Non-text portions of this message have been removed]
Why don't you use the one that is already written and buit into Vista?

________________________________

From: vantage@yahoogroups.com on behalf of Patrick
Sent: Tue 2/5/2008 6:33 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BAM alerts sending old data information



Dangit, I keep forgetting to state my version, I'm using 8.03.

The need for the emails is we allow sales people to create customers
so they can create quotes on the fly, however we don't want them
modifying credit limits or removing them from credit hold without
reason. We want emails sent to the financial people just to let them
know when someone has toggled a credit hold for a customer, that way
they know when someone has turned it off or modified the limit that's
not from finance.

Problem is I'm not getting consistent data from the BAM program
variables. If I create a new customer, Customer.Name sends the newly
created properly, howver Customer.ChangedBy sends a blank.

If I update a customer record, Customer.ChangedBy is sent with
whoever changed it last, so it's like it's sending the data from the
database before the update.

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , Robert Brown <robertb_versa@...>
wrote:
>
> Seems to me setting up an appropriate audit/change log for the
data would be a better solution on such (for most manufacturers)
rarely edited data. (The resulting add'l system load overhead would
be manageable.) I know 8.03 supports this but have no idea about
previous releases.
>
> Rob Brown
>
>
>
> Patrick <pbparker@...> wrote:
> I've set up a BAM to run my own program that sends email
whenever
> someone toggles a Customer's credit hold to off. (I tried to use a
BPM
> initially but couldn't find the method that would trigger on
CreditHold
> toggling even though some look like they would do that).
>
> Anyways, the emails from the program are sending data that was in
the
> table BEFORE the update. Example is if I use Customer.ChangedBy as
a
> variable in the program, it's either blank for new records being
> created, or the value that was in the table before someone changes
it.
>
> At the beginning of my program I'm declaring:
> {ud/GlbAlert.i &TableName = "Customer"}
>
> I would have figured had I put "OLDCustomer" I would be getting the
old
> data, but still I get it this way. Anyone have any idea on where
I'm
> going wrong here?
>
>
>
>
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
>
> [Non-text portions of this message have been removed]
>






[Non-text portions of this message have been removed]
Yes, basically that's exactly the issue, I'm getting the same values
for variables called with OLD and without. So, as you say the data
is getting set before the BAM executes. I've gone through all sorts
of iterations and looks like I won't be able to do this.

The BAM applications don't execute VB I don't believe (am I wrong on
this?). I believe they're executing a 4GL language correct? Does
anyone have a language reference for programming these? I was trying
to figure out how to convert a numeric variable to text to return in
an alert.

For those who continue asking why I don't use the built in alert - it
doesn't indicate who made the change nor does it indicate if the
customer is new or an existing one.

--- In vantage@yahoogroups.com, Robert Brown <robertb_versa@...>
wrote:
>
> I get it... The BAM captures the values before the adapter is
called to update the record to the entered new values.
>
> I have ZERO experience with it, but your need sounds very much
like what Epicor sales claims auditing can do (and is intended for).
>
> That said, little in 8.03 acts as nicely as the sales scripts
portrayed.
>
> It would probably be a pain to code, but you could do an app
customization that is triggered by appropriate before event(s),
captures the original data in appropriate temp variables or an array,
and then uses appropriate after change event(s) to capture the new
values (and who made the change, etc.,) - finally firing off a
barebones email to an email group account named for the role of the
group of people that do this checking of changes.
>
> The email send portion would likely be the 'painful' portion to
code (at least it would be for me) - assuming this decapitated,
customized version of VB supplied with 8.03 even supports it.
>
> Rob Brown
>
>
>
> Patrick <pbparker@...> wrote:
> Dangit, I keep forgetting to state my version, I'm using
8.03.
>
> The need for the emails is we allow sales people to create
customers
> so they can create quotes on the fly, however we don't want them
> modifying credit limits or removing them from credit hold without
> reason. We want emails sent to the financial people just to let
them
> know when someone has toggled a credit hold for a customer, that
way
> they know when someone has turned it off or modified the limit
that's
> not from finance.
>
> Problem is I'm not getting consistent data from the BAM program
> variables. If I create a new customer, Customer.Name sends the
newly
> created properly, howver Customer.ChangedBy sends a blank.
>
> If I update a customer record, Customer.ChangedBy is sent with
> whoever changed it last, so it's like it's sending the data from
the
> database before the update.
>
> --- In vantage@yahoogroups.com, Robert Brown <robertb_versa@>
> wrote:
> >
> > Seems to me setting up an appropriate audit/change log for the
> data would be a better solution on such (for most manufacturers)
> rarely edited data. (The resulting add'l system load overhead would
> be manageable.) I know 8.03 supports this but have no idea about
> previous releases.
> >
> > Rob Brown
> >
> >
> >
> > Patrick <pbparker@> wrote:
> > I've set up a BAM to run my own program that sends email
> whenever
> > someone toggles a Customer's credit hold to off. (I tried to use
a
> BPM
> > initially but couldn't find the method that would trigger on
> CreditHold
> > toggling even though some look like they would do that).
> >
> > Anyways, the emails from the program are sending data that was in
> the
> > table BEFORE the update. Example is if I use Customer.ChangedBy
as
> a
> > variable in the program, it's either blank for new records being
> > created, or the value that was in the table before someone
changes
> it.
> >
> > At the beginning of my program I'm declaring:
> > {ud/GlbAlert.i &TableName = "Customer"}
> >
> > I would have figured had I put "OLDCustomer" I would be getting
the
> old
> > data, but still I get it this way. Anyone have any idea on where
> I'm
> > going wrong here?
> >
> >
> >
> >
> >
> >
> > ---------------------------------
> > Never miss a thing. Make Yahoo your homepage.
> >
> > [Non-text portions of this message have been removed]
> >
>
>
>
>
>
>
> ---------------------------------
> Never miss a thing. Make Yahoo your homepage.
>
> [Non-text portions of this message have been removed]
>
You are correct, BAM is 4GL. As for a reference guide, there are guides
available from Progress.
The next question is...do you really need the (I think 400 page) guide? I
believe for the most part the answer is no when it comes to just creating
BAM alerts. You will find the progress help a huge resource with examples.
I love to use ConText to edit the .p files as it highlights the language to
make it easier to see mistakes and such. It also can be configured
relatively easily to enable context sensitive help with the F1 key.
Therefore you can be typing a function and press F1 to get explanations and
examples of code that are specific to what you are doing.
That being said...the function you are looking for is string(numeric value).
This will convert "numeric value" into a text value or numbers as text.
The bigger problem is the triggering of your BAM before the record update
has been finalized. Are you sure you are using a BAM and not a BPM to
trigger the alert. BPMs can be configured to run before or after updates to
the dataset, but a true BAM should run after the actual database record has
been finalized and is ready to be written. This concerns me greatly that
you are getting BAMs that trigger before the record is finalized completely.
Would you mind posting the code you have written with an explanation of the
fields that are selected to trigger the BAM? I would be very interested in
looking over what you have done to see if there might be a reason for the
inconsistent results.
Best of luck,
Aaron Hoyt
Vantage Plastics
-----Original Message-----
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On Behalf Of
Patrick Parker
Sent: Thursday, February 14, 2008 4:02 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: BAM alerts sending old data information


The BAM applications don't execute VB I don't believe (am I wrong on
this?). I believe they're executing a 4GL language correct? Does
anyone have a language reference for programming these? I was trying
to figure out how to convert a numeric variable to text to return in
an alert.


Recent Activity
a.. 4New Members
Visit Your Group
Yahoo! Finance
It's Now Personal

Guides, news,

advice & more.

Search Ads
Get new customers.

List your web site

in Yahoo! Search.

Yahoo! Groups
Cat Zone

Connect w/ others

who love cats.
.



[Non-text portions of this message have been removed]
Aha! I threw in a few more fields to test and the rest are working
properly with the <variable> and OLD<variable> methodology. The only
field that doesn't work properly is the ChangedBy field, which
returns the old data before database modification for both values.
It doesn't appear that I'm able to get the value of who is currently
changing the record. (This is a BAM .p file)

Here's the basic code (there's duplicate fields everywhere for my
debugging tests). The BAM is set up on the Customer table with
selected fields of CreditHold and CreditLimit and the alert program
to the below. The two ChangedBy fields below always return the same
value - that of what was in the database prior to the change.

/***********
include Global Alert file - Customer table was selected in BAM
*************/
{ud/GlbAlert.i &TableName = "Customer"}

/**************
test to see if the new customer record was completed.
**************/
IF Customer.Name = "" THEN DO:
RETURN "Cancel Send":U.
END.

ASSIGN Email-From = "vantage-test@...".
ASSIGN Email-To = "pparker@...".

IF Customer.ChangedBy <> "" THEN DO:
IF Customer.CreditHold THEN DO:
ASSIGN Email-Subject = "TEST: Customer Placed on Credit Hold".
ASSIGN Email-Text = "Customer """ + Customer.Name
+ """ has been placed on credit hold by " + Customer.ChangedBy
+ OLDCustomer.ChangedBy + string(Customer.CreditLimit) +
string(OLDCustomer.CreditLimit) + ".".
END.
ELSE DO:
ASSIGN Email-Subject = "TEST: Customer Taken off Credit Hold".
ASSIGN Email-Text = "Customer """ + Customer.Name
+ """ has been taken off credit hold by " + Customer.ChangedBy
+ OLDCustomer.ChangedBy + string(Customer.CreditLimit) +
string(OLDCustomer.CreditLimit) + ".".
END.
END.

--- In vantage@yahoogroups.com, "Aaron Hoyt" <aaron.hoyt@...> wrote:
>
> You are correct, BAM is 4GL. As for a reference guide, there are
guides
> available from Progress.
> The next question is...do you really need the (I think 400 page)
guide? I
> believe for the most part the answer is no when it comes to just
creating
> BAM alerts. You will find the progress help a huge resource with
examples.
> I love to use ConText to edit the .p files as it highlights the
language to
> make it easier to see mistakes and such. It also can be configured
> relatively easily to enable context sensitive help with the F1 key.
> Therefore you can be typing a function and press F1 to get
explanations and
> examples of code that are specific to what you are doing.
> That being said...the function you are looking for is string
(numeric value).
> This will convert "numeric value" into a text value or numbers as
text.
> The bigger problem is the triggering of your BAM before the record
update
> has been finalized. Are you sure you are using a BAM and not a BPM
to
> trigger the alert. BPMs can be configured to run before or after
updates to
> the dataset, but a true BAM should run after the actual database
record has
> been finalized and is ready to be written. This concerns me
greatly that
> you are getting BAMs that trigger before the record is finalized
completely.
> Would you mind posting the code you have written with an
explanation of the
> fields that are selected to trigger the BAM? I would be very
interested in
> looking over what you have done to see if there might be a reason
for the
> inconsistent results.
> Best of luck,
> Aaron Hoyt
> Vantage Plastics
> -----Original Message-----
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]On
Behalf Of
> Patrick Parker
> Sent: Thursday, February 14, 2008 4:02 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Re: BAM alerts sending old data information
>
>
> The BAM applications don't execute VB I don't believe (am I wrong
on
> this?). I believe they're executing a 4GL language correct? Does
> anyone have a language reference for programming these? I was
trying
> to figure out how to convert a numeric variable to text to return
in
> an alert.
>
>
> Recent Activity
> a.. 4New Members
> Visit Your Group
> Yahoo! Finance
> It's Now Personal
>
> Guides, news,
>
> advice & more.
>
> Search Ads
> Get new customers.
>
> List your web site
>
> in Yahoo! Search.
>
> Yahoo! Groups
> Cat Zone
>
> Connect w/ others
>
> who love cats.
> .
>
>
>
> [Non-text portions of this message have been removed]
>