This code would work, but I recommend you include the company field in all
of your FIND statements. Not only is that needed when you have multiple
companies, but it's good practice even for a single company. For started,
Company is a key to almost every file, and without it you impact the query
performance. Second, you never know when you'll add another company to your
DB, and this can save you issues down the road.
One other point of clarification, you don't need the "if available
shipdtl.", as it's a FOR EACH. If none are available, it just doesn't
execute the loop.
Kevin Simon
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
mmcwilliams22
Sent: Thursday, March 10, 2011 12:57 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: 4GL example
Something like this should work.
find first ttShipHead where ttShiphead.ShipStatus = "Shipped" no-lock
no-error.
if available ttShipHead then do:
for each ShipDtl where ShipDtl.Packnum = ttShipHead.PackNum no-lock.
if available ShipDtl then do:
for each orderhed where orderHed.OrderNum = shipdtl.OrderNum.
find first userfile where userfile.DcdUserID = OrderHed.EntryPerson.
'//the rest of your code'//
--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"cooner_55421" <cooner_55421@...> wrote:
with until after I find the order record.
Behalf Of
of your FIND statements. Not only is that needed when you have multiple
companies, but it's good practice even for a single company. For started,
Company is a key to almost every file, and without it you impact the query
performance. Second, you never know when you'll add another company to your
DB, and this can save you issues down the road.
One other point of clarification, you don't need the "if available
shipdtl.", as it's a FOR EACH. If none are available, it just doesn't
execute the loop.
Kevin Simon
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
mmcwilliams22
Sent: Thursday, March 10, 2011 12:57 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: 4GL example
Something like this should work.
find first ttShipHead where ttShiphead.ShipStatus = "Shipped" no-lock
no-error.
if available ttShipHead then do:
for each ShipDtl where ShipDtl.Packnum = ttShipHead.PackNum no-lock.
if available ShipDtl then do:
for each orderhed where orderHed.OrderNum = shipdtl.OrderNum.
find first userfile where userfile.DcdUserID = OrderHed.EntryPerson.
'//the rest of your code'//
--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ,
"cooner_55421" <cooner_55421@...> wrote:
>table, I only have the order number. I don't have the entry person to work
> Hi Kevin,
>
> I'm confused because I'm starting from the ShipDtl record. From that
with until after I find the order record.
> Is this possible in 4GL?during order entry. But this seemed like it was overkill.
>
>
> To get by, I set up a BPM to store the user email address in a UD field
>Simon" <ksimon@> wrote:
> Thanks
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Kevin
> >[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
> > The code you likely will need to include is:
> >
> >
> >
> > FIND UserFile WHERE UserFile.DCDUserID = OrderHed.EntryPerson NO-ERROR.
> >
> > ASSIGN whateveryouwantfield = UserFile.EmailAddress.
> >
> >
> >
> > Hope that helps.
> >
> >
> >
> > Kevin Simon
> >
> >
> >
> > From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Behalf Of
> > cooner_55421[Non-text portions of this message have been removed]
> > Sent: Wednesday, March 09, 2011 6:19 PM
> > To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> > Subject: [Vantage] 4GL example
> >
> >
> >
> >
> >
> > Hi,
> >
> > I am working on a BPM email generated by the ShipDtl.Update.
> > Everything is working EXCEPT, I'd like to include a value
> > UserFile.EmailAddress.
> >
> > I can see it with a query.
> >
> > ShipDtl.OrderNum --> OrderHead.OrderNum
> > OrderHead.EntryPerson --> UserFile.DcdUserID
> > --> UserFile.EmailAddress
> >
> > Does anybody have a 4GL example for something like this?
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>