Trigger for Trailer Codes

Chris Kelleher

Administrator
Staff member
Peggers,

Hope you can help with making a trigger fire. Character version 8.5G.

The second last frame of the sales order entry screens - 7.1 sosomt.p - has
three trailer codes. I need to attach a trigger that checks the validity of
these codes (based on the value of the shipvia field, so generalized codes
won't work). In other words, if the shipvia field says prepaid freight is
$200 and the order amount is $100, one of the trailer codes has to be for
freight. If they enter a trailer code, then I can make the trigger fire by
using an assign on so_trl1_cd.

But, they don't always enter a trailer code - so I need the trigger to fire
on some other event. The other fields in the frame are all populated
earlier in the order entry, so an assign trigger on something like
so_disc_pct doesn't fire at the right time.

"On leave of field in frame" doesn't seem to work either. We put the call
to the encrypted procedure both before and after the on-leave, and neither
worked.

Any suggestions???

Thanks!
Marj MacDonald,
Sr. Systems Analyst.
Algonquin Group Inc.
 

Chris Kelleher

Administrator
Staff member
Hi,
Just did a very quick test with the following code :

{mfdeclre.i}

on find of so_mstr do:
message "testing" frame-name frame-field. pause.
end.

{gprun.i ""sosomt.p""}

I believe that you could build in your tests (check for whatever
you
wish to check for), on the find of so_mstr when the frame-name is
"sotot". That
is the last find in the code and is approximately where you need it. I
have done
some codes using similar triggering. It's a little crude but works
effectively.
It will fire everytime but the code chunk will execute only for the
given
frame-name. Will have to test the same well and ensure that it works
with all
settings in the control file.
Please let me know if you need any more inputs.

Regards,
Kawal.

--
______________________________________________________________________

Kawal Batra
Application Specialist
Thirdware Consulting, India.

Tel: 91-22-8292225/2302.
Fax: 91-22-8292102.

e-mail: kawal@tspl.com
______________________________________________________________________
 

Chris Kelleher

Administrator
Staff member
"On leave of field in frame" doesn't work because the frame is local to that
procedure. You might have to say something like:

on leave anywhere
do:
if frame-name = "xxx" and frame-field = "xxx"

Ugly and full of overhead, but it should work better.

Another trick I've tried is to actually consider the encrypted source an include
file. You could even copy it to a file with a .i prefix. Let's say it's sosomtc.p.
Copy it to sosomtc.i, then write a custom sosomtc.p that says:

on leave of field in frame
/* trigger code */

{xrc/sosomtc.i}

In a sense, you're adding unencrypted code to an encrypted procedure.
---------------
Paul T. O'Leary
Evco Plastics, a leader in plastics injection molding
DeForest, WI USA
 
Top