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.
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]