Data Directive to save record of PartCost

My bad. Data directives do not display the message statements
(PublishInfoMsg) to the screen as method directives do. My assumption is
that data directives are not necessarily tied to a user interfacing with the
system, so there may not always be a screen to display it to.



Replace the messages you are doing to the screen with the old "MESSAGE"
statement, which will write it to the app server log.



Kevin



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
tchristie1
Sent: Monday, February 06, 2012 10:06 AM
To: vantage@yahoogroups.com
Subject: [Vantage] Re: Data Directive to save record of PartCost





I do not hit any of the message statements. My thought was that perhaps data
directives cannot show messages like method directives.

I will checkout the app server log too.

Thanks,

Tom

--- In vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> , "Kevin
Simon" <simstrak@...> wrote:
>
> There are some minor items I see in your code that would make it run a bit
> more efficiently, but nothing I see that would prevent it from running.
>
>
>
> When you execute this, do you hit any of the message statements you have
in
> the program? Have you checked your app server log to see if any messages
> are there?
>
>
>
> Kevin Simon
> SimsTrak Consulting
>
>
>
> From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf Of
> tchristie1
> Sent: Friday, February 03, 2012 6:24 PM
> To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
> Subject: [Vantage] Data Directive to save record of PartCost
>
>
>
>
>
> I am looking to write a data directive that looks at part cost and creates
a
> record in UD07 when a partcost record changes. It will allow us to look
> historically at the changes in part cost.
>
> I have created the BPM with the conditions that if any of the last cost
> fields change from any to any then run the code.
>
> The code has a two parts. First piece looks to see if i already have
created
> a record for that partnum. If so, increase the part's index value (key5)
by
> one. The second piece than generates the new row storing the part, the
> costs, and today's date.
>
> That's it. But it doesn't run. Validates fine, just never produces any
> records. What am I missing?
>
> -------------
>
> define var iCount as integer.
> {lib/PublishInfoMsg.i &InfoMsg = "'Trying to build a record.'"}
> for each ttpartcost where ttpartcost.company = cur-comp.
> iCount = 1.
> find last ud07 where ud07.key1 = ttpartcost.PartNum.
> if avail ud07 then do:
> iCount = ud07.number06 + 1.
> end.
> {lib/PublishInfoMsg.i &InfoMsg = "'Set Count.'"}
> Create UD07.
> Assign
> UD07.key1 = string(ttpartcost.partnum).
> UD07.key2 = "0".
> UD07.key3 = "0".
> UD07.key4 = "0".
> UD07.key5 = string(iCount).
> UD07.number01 = ttpartcost.LastBurdenCost.
> UD07.Number02 = ttpartcost.LastLaborCost.
> UD07.number03 = ttpartcost.LastMaterialCost.
> UD07.number04 = ttpartcost.LastMtlBurCost.
> UD07.number05 = ttpartcost.LastSubContCost.
> UD07.number06 = iCount.
> UD07.date01 = today.
> UD07.company = ttpartcost.Company.
> Release UD07.
> {lib/PublishInfoMsg.i &InfoMsg = "'Released UD07.'"}
> end.
>
>
>
>
>
> [Non-text portions of this message have been removed]
>





[Non-text portions of this message have been removed]
I am looking to write a data directive that looks at part cost and creates a record in UD07 when a partcost record changes. It will allow us to look historically at the changes in part cost.

I have created the BPM with the conditions that if any of the last cost fields change from any to any then run the code.

The code has a two parts. First piece looks to see if i already have created a record for that partnum. If so, increase the part's index value (key5) by one. The second piece than generates the new row storing the part, the costs, and today's date.

That's it. But it doesn't run. Validates fine, just never produces any records. What am I missing?

-------------

define var iCount as integer.
{lib/PublishInfoMsg.i &InfoMsg = "'Trying to build a record.'"}
for each ttpartcost where ttpartcost.company = cur-comp.
iCount = 1.
find last ud07 where ud07.key1 = ttpartcost.PartNum.
if avail ud07 then do:
iCount = ud07.number06 + 1.
end.
{lib/PublishInfoMsg.i &InfoMsg = "'Set Count.'"}
Create UD07.
Assign
UD07.key1 = string(ttpartcost.partnum).
UD07.key2 = "0".
UD07.key3 = "0".
UD07.key4 = "0".
UD07.key5 = string(iCount).
UD07.number01 = ttpartcost.LastBurdenCost.
UD07.Number02 = ttpartcost.LastLaborCost.
UD07.number03 = ttpartcost.LastMaterialCost.
UD07.number04 = ttpartcost.LastMtlBurCost.
UD07.number05 = ttpartcost.LastSubContCost.
UD07.number06 = iCount.
UD07.date01 = today.
UD07.company = ttpartcost.Company.
Release UD07.
{lib/PublishInfoMsg.i &InfoMsg = "'Released UD07.'"}
end.
There are some minor items I see in your code that would make it run a bit
more efficiently, but nothing I see that would prevent it from running.



When you execute this, do you hit any of the message statements you have in
the program? Have you checked your app server log to see if any messages
are there?



Kevin Simon
SimsTrak Consulting



From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
tchristie1
Sent: Friday, February 03, 2012 6:24 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Data Directive to save record of PartCost





I am looking to write a data directive that looks at part cost and creates a
record in UD07 when a partcost record changes. It will allow us to look
historically at the changes in part cost.

I have created the BPM with the conditions that if any of the last cost
fields change from any to any then run the code.

The code has a two parts. First piece looks to see if i already have created
a record for that partnum. If so, increase the part's index value (key5) by
one. The second piece than generates the new row storing the part, the
costs, and today's date.

That's it. But it doesn't run. Validates fine, just never produces any
records. What am I missing?

-------------

define var iCount as integer.
{lib/PublishInfoMsg.i &InfoMsg = "'Trying to build a record.'"}
for each ttpartcost where ttpartcost.company = cur-comp.
iCount = 1.
find last ud07 where ud07.key1 = ttpartcost.PartNum.
if avail ud07 then do:
iCount = ud07.number06 + 1.
end.
{lib/PublishInfoMsg.i &InfoMsg = "'Set Count.'"}
Create UD07.
Assign
UD07.key1 = string(ttpartcost.partnum).
UD07.key2 = "0".
UD07.key3 = "0".
UD07.key4 = "0".
UD07.key5 = string(iCount).
UD07.number01 = ttpartcost.LastBurdenCost.
UD07.Number02 = ttpartcost.LastLaborCost.
UD07.number03 = ttpartcost.LastMaterialCost.
UD07.number04 = ttpartcost.LastMtlBurCost.
UD07.number05 = ttpartcost.LastSubContCost.
UD07.number06 = iCount.
UD07.date01 = today.
UD07.company = ttpartcost.Company.
Release UD07.
{lib/PublishInfoMsg.i &InfoMsg = "'Released UD07.'"}
end.





[Non-text portions of this message have been removed]
I do not hit any of the message statements. My thought was that perhaps data directives cannot show messages like method directives.

I will checkout the app server log too.

Thanks,

Tom


--- In vantage@yahoogroups.com, "Kevin Simon" <simstrak@...> wrote:
>
> There are some minor items I see in your code that would make it run a bit
> more efficiently, but nothing I see that would prevent it from running.
>
>
>
> When you execute this, do you hit any of the message statements you have in
> the program? Have you checked your app server log to see if any messages
> are there?
>
>
>
> Kevin Simon
> SimsTrak Consulting
>
>
>
> From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
> tchristie1
> Sent: Friday, February 03, 2012 6:24 PM
> To: vantage@yahoogroups.com
> Subject: [Vantage] Data Directive to save record of PartCost
>
>
>
>
>
> I am looking to write a data directive that looks at part cost and creates a
> record in UD07 when a partcost record changes. It will allow us to look
> historically at the changes in part cost.
>
> I have created the BPM with the conditions that if any of the last cost
> fields change from any to any then run the code.
>
> The code has a two parts. First piece looks to see if i already have created
> a record for that partnum. If so, increase the part's index value (key5) by
> one. The second piece than generates the new row storing the part, the
> costs, and today's date.
>
> That's it. But it doesn't run. Validates fine, just never produces any
> records. What am I missing?
>
> -------------
>
> define var iCount as integer.
> {lib/PublishInfoMsg.i &InfoMsg = "'Trying to build a record.'"}
> for each ttpartcost where ttpartcost.company = cur-comp.
> iCount = 1.
> find last ud07 where ud07.key1 = ttpartcost.PartNum.
> if avail ud07 then do:
> iCount = ud07.number06 + 1.
> end.
> {lib/PublishInfoMsg.i &InfoMsg = "'Set Count.'"}
> Create UD07.
> Assign
> UD07.key1 = string(ttpartcost.partnum).
> UD07.key2 = "0".
> UD07.key3 = "0".
> UD07.key4 = "0".
> UD07.key5 = string(iCount).
> UD07.number01 = ttpartcost.LastBurdenCost.
> UD07.Number02 = ttpartcost.LastLaborCost.
> UD07.number03 = ttpartcost.LastMaterialCost.
> UD07.number04 = ttpartcost.LastMtlBurCost.
> UD07.number05 = ttpartcost.LastSubContCost.
> UD07.number06 = iCount.
> UD07.date01 = today.
> UD07.company = ttpartcost.Company.
> Release UD07.
> {lib/PublishInfoMsg.i &InfoMsg = "'Released UD07.'"}
> end.
>
>
>
>
>
> [Non-text portions of this message have been removed]
>