× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rob,

I clearly see what you are saying. If the example were written in RPG2
or 3, I might be able to grasp it (It is hard to change an old person
like me).

Actually, when I first did the ADDPFTRG, I was HOPING that I could
simply key a SELECT statement which would only FIRE the trigger when a
certain Vendor # was "accessed".

Thanks,
Don

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 26, 2007 1:12 PM
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

But you're forgetting the whole point of a trigger!

Ok, now for a little history...

Back in the dark ages one would have the Never Ending Program (NEP) that
would occasional query the database for changes. If it found any, it
would perform the actions you are talking about. I have a coworker who
installed one of these in the last year or two despite my STRONG
encouragement to use a trigger.

Then they came up with triggers. Why do you insist on querying the
database for changes? The G..D... trigger has the changes in it. You
do not need to restore a before and after image someplace to see what
was changed. They are passed as parameters to the trigger. Please see
the two data structures NEW and OLD in the sample I posted.

In your technique if someone updates three PO's you are going to query
the whole stinking database 3 times looking for any changes. However,
if you use a trigger you would already know which particular PO got
updated during the trigger by looking at the fields in the datastructure
NEW. If you wanted to know if the PO status field changed you could
compare NEW.PSTAT against OLD.PSTAT (we're running BPCSCD also).


Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Don Cavaiani" <dcavaiani@xxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/26/2007 01:52 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Brainstorming






Thank You. My hope is renewed. I had that thought in the back of my
mind!

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
lgoodbar@xxxxxxxxxxxxxx
Sent: Thursday, April 26, 2007 12:45 PM
To: midrange-l@xxxxxxxxxxxx
Subject: RE: Brainstorming

You can. See http://code.midrange.com/index.php?id=2b2560d170

The trick is to accept the parameters (buffer) and pass it to the
programs that perform the processing. In your case, if you just want to
email, accept the parameters and don't update anything.

Loyd Goodbar
Senior programmer/analyst
BorgWarner
TS Water Valley
662-473-5713

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Don Cavaiani
Sent: Thursday, April 26, 2007 12:38
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

Never having learned much more coding than RPG 2, I guess I was hoping
for a simple way to trigger just a CLP - which would probably contain a
query or two which would "select" out only the records for the vendor in
question, and only those which have been changed or added since last
"trigger". Then, probably an auto PC support download, and an email
with attachment out to the vendor. I had these visions
..................

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 26, 2007 12:28 PM
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

Yes it should "be work". But it won't work. :-)

When a trigger is fired many parameters are implicitly added. Including
such information as to what file, in what library, was updated. Also
what the record format look like before, and after, the change. That
way you can automatically do stuff like "I only care if they changed
certain fields on the PO. Like, if they changed the shipping address I
could not care. But if they changed the status to say shipped I want to
send a notice to the customer that it was shipped at this date/time on
this truck.

Now, with all the parameters automatically sent to the program you
should NOT chain back to the file that the trigger was based on. Why
would you have a need to? All the information is in the parameters.
Unless you are doing something really weird like sending the customer a
list of, not only this po, but all po's they have with you.

(As I am typing I just realized that I am confusing PO's, customers and
vendors - try to get past that.)


Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Don Cavaiani" <dcavaiani@xxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/26/2007 01:00 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Brainstorming






Thanks, Rob. I will now have to STUDY a lot more!

I still think my "simple" idea should be work. :-)

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 26, 2007 11:56 AM
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

You've no parameters laddie. Check out the following:

http://code.midrange.com/index.php?id=e789b62b9e

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Don Cavaiani" <dcavaiani@xxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/26/2007 12:04 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Brainstorming






http://code.midrange.com/index.php?id=bb40c481f4

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 26, 2007 10:58 AM
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

post code at http://code.midrange.com/
and post resultant url back

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





"Don Cavaiani" <dcavaiani@xxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/26/2007 11:53 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
"Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Brainstorming






This said to look at previous messages, but there were none??

Message . . . . : Error occurred in trigger program.



Cause . . . . . : The trigger program which was called as the result
of a
database insert, update, delete, or read operation failed. See the
previous
messages in the job log to determine the error. The error code is 2
for
trigger POTRIGGER in library BPCSCDUSR type *SYS. This error code can
be
used to determine the trigger which caused the error, as follows:

1 -- *BEFORE *INSERT trigger

2 -- *AFTER *INSERT trigger

3 -- *BEFORE *UPDATE trigger

4 -- *AFTER *UPDATE trigger

5 -- *BEFORE *DELETE trigger

6 -- *AFTER *DELETE trigger


-----Original Message-----
From: midrange-l-bounces+dcavaiani=amerequip.com@xxxxxxxxxxxx
[mailto:midrange-l-bounces+dcavaiani=amerequip.com@xxxxxxxxxxxx] On
Behalf Of rob@xxxxxxxxx
Sent: Thursday, April 26, 2007 7:37 AM
To: Midrange Systems Technical Discussion
Subject: RE: Brainstorming

We do have BPCS. Sounds very simple. Unless you are really banging out
purchase orders you shouldn't have to have a NEP job processing trigger
requests. Heck the key think time may be more significant. After all,
how many people would submit that process off as a batch job to PO Entry
versus online if they were doing it by modifying the PO programs versus
a trigger? A few? At least, sure.

If you need a sample shell to work with let me know.

Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





<lgoodbar@xxxxxxxxxxxxxx>
Sent by: midrange-l-bounces@xxxxxxxxxxxx
04/26/2007 08:17 AM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
<midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
RE: Brainstorming






Sounds like a plan. I would separate the task into two tasks: the
trigger that accepts the changes, and a submitted or never-ending job
that creates PDFs, sends email, etc. The trigger process should be as
lightweight as possible since it's fired for each row processed. This
also allows you to change the feature set in the future without
necessarily changing the trigger program.

We don't have BPCS so can't comment on the actual files used.

HTH,
Loyd

Loyd Goodbar
Senior programmer/analyst
BorgWarner
TS Water Valley
662-473-5713
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Don Cavaiani
Sent: Wednesday, April 25, 2007 18:56
To: Midrange Systems Technical Discussion
Cc: Tom Maresh; Gary Brochtrup; Michelle Pingel
Subject: Brainstorming

One of our mfg. outsourcing suppliers would like to know whenever we
create/modify a P.O. (BPCS HPH/HPO) against their vendor number.

Although I've never done this, I was wondering if a trigger could be
assigned to these files, then at least an email, or email with say a pdf
or excel file attachment, would be automatically sent to their company.

Thanks in advance!



Don F. Cavaiani
IT Manager
Amerequip Corp.
920-894-7063




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.