4GL example Blank Title 98518

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:
>
> Hi Kevin,
>
> I'm confused because I'm starting from the ShipDtl record. From that
table, I only have the order number. I don't have the entry person to work
with until after I find the order record.
> Is this possible in 4GL?
>
>
> To get by, I set up a BPM to store the user email address in a UD field
during order entry. But this seemed like it was overkill.
>
> Thanks
>
> --- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Kevin
Simon" <ksimon@> wrote:
> >
> > 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>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
> > cooner_55421
> > 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]
> >
>





[Non-text portions of this message have been removed]
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@yahoogroups.com] On Behalf Of
cooner_55421
Sent: Wednesday, March 09, 2011 6:19 PM
To: vantage@yahoogroups.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]
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, "cooner_55421" <cooner_55421@...> wrote:
>
> Hi Kevin,
>
> I'm confused because I'm starting from the ShipDtl record. From that table, I only have the order number. I don't have the entry person to work with until after I find the order record.
> Is this possible in 4GL?
>
>
> To get by, I set up a BPM to store the user email address in a UD field during order entry. But this seemed like it was overkill.
>
> Thanks
>
> --- In vantage@yahoogroups.com, "Kevin Simon" <ksimon@> wrote:
> >
> > 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@yahoogroups.com] On Behalf Of
> > cooner_55421
> > Sent: Wednesday, March 09, 2011 6:19 PM
> > To: vantage@yahoogroups.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]
> >
>