Updating OrderDtl/OrderRel NeedBy and ReqDate in 4GL BPM

Hi Brian,

I had to do this same thing where the needby and request date fields needed to be changed at order entry time or when an order was later changed. What I did was set up a pre-process BPM for OrderHed and a post-process BPM for the OrderDtl and OrderRel table to update my date fields.

David Pfiester
NuStep, Inc.
734-769-3939 x150

--- In vantage@yahoogroups.com, "Brian W. Spolarich " <bspolarich@...> wrote:
>
> For reasons that you don't really want to understand, I have a need to do a mass update (swap really) of a bunch of dates in the open sales orders in one of my companies. Basically all open sales orders needs to have all of their NeedBy and ReqDate dates swapped.
>
> This looked doable in a BPM as I could trigger the update via checkbox change in OrderHed and having someone tick through the set of open orders wouldn't be a big deal.
>
> However, it turns out that if I trigger this off of the update of OrderHed.Checkbox01, only ttOrderHed has any data (ttOrderDtl and ttOrderRel seem to be empty of rows, despite the fact that in the trace I see the full dataset).
>
> If I try to iterate through OrderDtl and OrderRel and change data, I run into the OpenEdge licensing issue (you can't modify data). I haven't applied the new license to my production environment, but I could.
>
> My question is twofold:
>
> 1. Am I missing something? In the client trace I see the full dataset, but if I iterate over ttOrderDtl/ttOrderRel, I don't see any data in my for each statement (just for the header), however if I change the temp-tables to their actual counterparts I get the data I expect in my appserver log. I assumed that since the full dataset in the trace contains the entire SalesOrderDataSet that the temp-tables would also contain the entire thing.
>
> Here's my code, just looking for data:
>
> for each ttOrderHed where ttOrderHed.RowMod = 'U'.
> message "SwapShipDateandNeedByDate: Processing Order " + string(ttOrderHed.OrderNum).
> /* OrderDtl Block */
> for each ttOrderDtl where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum = ttOrderHed.OrderNum and ttOrderDtl.OpenLine = True.
> message "Processing OrderDtl " + string(ttOrderDtl.OrderLine).
> define variable curOrderDtlNeedByDate as Date no-undo.
> define variable curOrderDtlReqDate as Date no-undo.
> curOrderDtlNeedByDate = ttOrderDtl.NeedByDate.
> curOrderDtlReqDate = ttOrderDtl.RequestDate.
> /* OrderRel Block */
> for each ttOrderRel where ttOrderRel.Company = ttOrderDtl.Company and ttOrderRel.OrderNum = ttOrderDtl.OrderNum and ttOrderRel.OrderLine = ttOrderDtl.OrderLine and ttOrderRel.OpenRelease = True.
> message "Processing OrderRel " + string(ttOrderRel.OrderRelNum).
> define variable curOrderRelNeedByDate as Date no-undo.
> define variable curOrderRelReqDate as Date no-undo.
> curOrderRelNeedByDate = ttOrderRel.NeedByDate.
> curOrderRelReqDate = ttOrderRel.ReqDate.
> end.
> /* OrderRel Block */
> end.
> /* OrderDtl Block */
> end.
>
> 2. Can I safely modify the ReqDate (Ship By Date) in a 4GL action like this?
>
> I don't want to have to break out ServiceConnect, as this would be a tedious (for me at least) workflow to write for a one-time deal. I've not had to deal with searching and iterating over search results in sub-workflows.
>
> -bws
>
> --
> Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
> Â Â Â Â bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com
>
For reasons that you don't really want to understand, I have a need to do a mass update (swap really) of a bunch of dates in the open sales orders in one of my companies. Basically all open sales orders needs to have all of their NeedBy and ReqDate dates swapped.

This looked doable in a BPM as I could trigger the update via checkbox change in OrderHed and having someone tick through the set of open orders wouldn't be a big deal.

However, it turns out that if I trigger this off of the update of OrderHed.Checkbox01, only ttOrderHed has any data (ttOrderDtl and ttOrderRel seem to be empty of rows, despite the fact that in the trace I see the full dataset).

If I try to iterate through OrderDtl and OrderRel and change data, I run into the OpenEdge licensing issue (you can't modify data). I haven't applied the new license to my production environment, but I could.

My question is twofold:

1. Am I missing something? In the client trace I see the full dataset, but if I iterate over ttOrderDtl/ttOrderRel, I don't see any data in my for each statement (just for the header), however if I change the temp-tables to their actual counterparts I get the data I expect in my appserver log. I assumed that since the full dataset in the trace contains the entire SalesOrderDataSet that the temp-tables would also contain the entire thing.

Here's my code, just looking for data:

for each ttOrderHed where ttOrderHed.RowMod = 'U'.
message "SwapShipDateandNeedByDate: Processing Order " + string(ttOrderHed.OrderNum).
/* OrderDtl Block */
for each ttOrderDtl where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum = ttOrderHed.OrderNum and ttOrderDtl.OpenLine = True.
message "Processing OrderDtl " + string(ttOrderDtl.OrderLine).
define variable curOrderDtlNeedByDate as Date no-undo.
define variable curOrderDtlReqDate as Date no-undo.
curOrderDtlNeedByDate = ttOrderDtl.NeedByDate.
curOrderDtlReqDate = ttOrderDtl.RequestDate.
/* OrderRel Block */
for each ttOrderRel where ttOrderRel.Company = ttOrderDtl.Company and ttOrderRel.OrderNum = ttOrderDtl.OrderNum and ttOrderRel.OrderLine = ttOrderDtl.OrderLine and ttOrderRel.OpenRelease = True.
message "Processing OrderRel " + string(ttOrderRel.OrderRelNum).
define variable curOrderRelNeedByDate as Date no-undo.
define variable curOrderRelReqDate as Date no-undo.
curOrderRelNeedByDate = ttOrderRel.NeedByDate.
curOrderRelReqDate = ttOrderRel.ReqDate.
end.
/* OrderRel Block */
end.
/* OrderDtl Block */
end.

2. Can I safely modify the ReqDate (Ship By Date) in a 4GL action like this?

I don't want to have to break out ServiceConnect, as this would be a tedious (for me at least) workflow to write for a one-time deal. I've not had to deal with searching and iterating over search results in sub-workflows.

-bws

--
Brian W. Spolarich ~ Manager, Information Services ~ Advanced Photonix / Picometrix
    bspolarich@... ~ 734-864-5618 ~ www.advancedphotonix.com