Hi Rob,
Below is the code I have so far. I've inserted an info message boxes for
debugging when it goes to update each line. It seems that ttOrderDtl
only has records when the line has been modified, which makes sense to
me.
When there are no records in ttOrderDtl, the info box, that should
display the message "Line", never displays.
/* Check each ttOrderHed. In theory, there should only be one. */
for each ttOrderHed where ttOrderHed.RowMod = 'U' or ttOrderHed.RowMod =
'A':
{lib/PublishInfoMsg.i &InfoMsg = "'Head - ' +
ttOrderHed.ShortChar01"}.
/* If the user selected or entered a ProjectID */
if ttOrderHed.ShortChar01 <> '' then do:
find first Project where Project.Company
= ttOrderHed.Company and Project.ProjectID = ttOrderHed.ShortChar01
no-lock no-error.
/* Check to see if it is a valid
ProjectID. User has the ability to manual type Project ID or search */
/* If the Project ID is valid, then
assign this Project ID to each Order line */
if available Project then do:
/* Sync
ttOrderDtl.ProjectID with ttOrderHed.ShortChar01 */
{lib/PublishInfoMsg.i
&InfoMsg = "'Project Exists'"}.
for each ttOrderDtl
where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i &InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ttOrderHed.ShortChar01.
end.
end.
/* If Project ID is NOT valid, alert the
user but save the Order with a blank project ID */
else do:
{lib/PublishInfoMsg.i
&InfoMsg = "'You entered an invalid Project ID. The Order was saved but
you will need to select a valid Project ID.'"}.
Assign
ttOrderHed.ShortChar01 = ''.
/* This is to ensure
that all Order lines are in sync with Order head */
for each ttOrderDtl
where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i &InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ''.
end.
end.
end.
else do:
/* If ttOrderHed.ShortChar01 is blank on
a changed row, then user could have cleared out the Project ID. Sync
lines to also be blank */
for each ttOrderDtl where
ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i
&InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ''.
end.
end.
end.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Friday, July 23, 2010 12:08 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Mark Sales Order Lines as "dirty" or changed
Joe,
Do you have any code written up to this point? If so, can I take a look
at it.
Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
<http://www.dsmfg.com/>
(Click the logo to view our site) <http://www.dsmfg.com/>
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Joe Rojas
Sent: Friday, July 23, 2010 10:35 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Mark Sales Order Lines as "dirty" or changed
Hi All,
I decided to make my post a little less verbose to see if I get a better
response. :)
I have a BPM that will sync a field from OrderHed to all associated
OrderDtl records.
The challenge is that the dataset used by the BPM does not always
contain records in ttOrderDtl, even when the sales order does have
lines.
Is there a way to mark the sale order lines as "dirty", even if there is
no change to them, so that ttOrderDtl will always contain all of the
lines?
Thanks!
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-1264 | fax: 781-341-5694
jrojas@... <mailto:jrojas%40matsinc.com>
<mailto:jrojas%40matsinc.com> | www.matsinc.com Ask
us about our clean, green and beautiful matting and flooring
This message is intended only for the individual named. If you are not
the named addressee you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
Below is the code I have so far. I've inserted an info message boxes for
debugging when it goes to update each line. It seems that ttOrderDtl
only has records when the line has been modified, which makes sense to
me.
When there are no records in ttOrderDtl, the info box, that should
display the message "Line", never displays.
/* Check each ttOrderHed. In theory, there should only be one. */
for each ttOrderHed where ttOrderHed.RowMod = 'U' or ttOrderHed.RowMod =
'A':
{lib/PublishInfoMsg.i &InfoMsg = "'Head - ' +
ttOrderHed.ShortChar01"}.
/* If the user selected or entered a ProjectID */
if ttOrderHed.ShortChar01 <> '' then do:
find first Project where Project.Company
= ttOrderHed.Company and Project.ProjectID = ttOrderHed.ShortChar01
no-lock no-error.
/* Check to see if it is a valid
ProjectID. User has the ability to manual type Project ID or search */
/* If the Project ID is valid, then
assign this Project ID to each Order line */
if available Project then do:
/* Sync
ttOrderDtl.ProjectID with ttOrderHed.ShortChar01 */
{lib/PublishInfoMsg.i
&InfoMsg = "'Project Exists'"}.
for each ttOrderDtl
where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i &InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ttOrderHed.ShortChar01.
end.
end.
/* If Project ID is NOT valid, alert the
user but save the Order with a blank project ID */
else do:
{lib/PublishInfoMsg.i
&InfoMsg = "'You entered an invalid Project ID. The Order was saved but
you will need to select a valid Project ID.'"}.
Assign
ttOrderHed.ShortChar01 = ''.
/* This is to ensure
that all Order lines are in sync with Order head */
for each ttOrderDtl
where ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i &InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ''.
end.
end.
end.
else do:
/* If ttOrderHed.ShortChar01 is blank on
a changed row, then user could have cleared out the Project ID. Sync
lines to also be blank */
for each ttOrderDtl where
ttOrderDtl.Company = ttOrderHed.Company and ttOrderDtl.OrderNum =
ttOrderHed.OrderNum:
{lib/PublishInfoMsg.i
&InfoMsg = "'Line'"}.
Assign
ttOrderDtl.ProjectID = ''.
end.
end.
end.
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf
Of Rob Bucek
Sent: Friday, July 23, 2010 12:08 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Mark Sales Order Lines as "dirty" or changed
Joe,
Do you have any code written up to this point? If so, can I take a look
at it.
Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
<http://www.dsmfg.com/>
(Click the logo to view our site) <http://www.dsmfg.com/>
From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
[mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On
Behalf
Of Joe Rojas
Sent: Friday, July 23, 2010 10:35 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Mark Sales Order Lines as "dirty" or changed
Hi All,
I decided to make my post a little less verbose to see if I get a better
response. :)
I have a BPM that will sync a field from OrderHed to all associated
OrderDtl records.
The challenge is that the dataset used by the BPM does not always
contain records in ttOrderDtl, even when the sales order does have
lines.
Is there a way to mark the sale order lines as "dirty", even if there is
no change to them, so that ttOrderDtl will always contain all of the
lines?
Thanks!
Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-1264 | fax: 781-341-5694
jrojas@... <mailto:jrojas%40matsinc.com>
<mailto:jrojas%40matsinc.com> | www.matsinc.com Ask
us about our clean, green and beautiful matting and flooring
This message is intended only for the individual named. If you are not
the named addressee you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately by e-mail if you have
received this e-mail by mistake. Please note that any views or opinions
presented in this email are solely those of the author and do not
necessarily represent those of the company.
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]