E9: Weird Data Directive Behavior

So I found the issue.

Someone had mistakenly cleared the Lock Line Quantity checkbox on this order line.
This resulted in unexpected behavior from Epicor.

When deleting a line like this, it appears that Epicor first does an update for some reason. During this update, the unit price gets updated to zero, which was triggering our code and throwing an error. Epicor would then do a delete.

After checking this box, Epicor only does a delete and all is good.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:cb58c6.png@a0e4a723.4abb83f9]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 2:02 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] E9: Weird Data Directive Behavior



What’s also weird is if I change it from PublishEx.i to PublishInfoMsg.i
It seems to work ok but then I noticed that my delete is being processed as an Update.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:676eeb.png@34813bb8.4eb0bcb1]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 1:54 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] E9: Weird Data Directive Behavior



Thanks for the reply Steven but this doesn’t address the main issue.
That code snippet shouldn’t even run if it’s a delete.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:3923fa.png@1d79d74a.43ade03e]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 12:52 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] E9: Weird Data Directive Behavior


What About:

if ((ttOrderDtl.Character09 = "") AND (ttOrderDtl.RowMod <> "D")) then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

Steven G.

On Tuesday, November 11, 2014 5:01 PM, "Joe Rojas jrojas@... [vantage]" <vantage@yahoogroups.com> wrote:


Hello,

We have a data directive on OrderDtl that runs custom code where the very first line is:

for each ttOrderDtl where ttOrderDtl.Company = cur-comp and (ttOrderDtl.RowMod = "A" or ttOrderDtl.RowMod = "U") and ttOrderDtl.kitFlag <> "C" and ttOrderDtl.OrderNum > 3181001 no-lock:

Ignoring the other criteria for a moment, the main part that is contributing to this “weirdness” is that you should only be in the for each loop if the row was updated or added.

There is a bunch of code in the loop but one particular snippet is:

if ttOrderDtl.Character09 = "" then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

The problem is, on a delete, this exception message is popping up.
I threw other information messages in the loops to see if I could debug it but those do not pop up, which makes sense because it is a delete BUT the exception message IS popping up.

Assuming that everything else is good, is there a problem with how I am throwing the exception message?
And speaking of “throwing”, I don’t really know what “{&THROW_PUBLIC}.” Is used for.
I’ve seen example where this was used and other where it’s not used.






Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:d3fca0.png@beab755a.4b96e927]
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]



[Non-text portions of this message have been removed]
Hello,

We have a data directive on OrderDtl that runs custom code where the very first line is:

for each ttOrderDtl where ttOrderDtl.Company = cur-comp and (ttOrderDtl.RowMod = "A" or ttOrderDtl.RowMod = "U") and ttOrderDtl.kitFlag <> "C" and ttOrderDtl.OrderNum > 3181001 no-lock:

Ignoring the other criteria for a moment, the main part that is contributing to this “weirdness” is that you should only be in the for each loop if the row was updated or added.

There is a bunch of code in the loop but one particular snippet is:

if ttOrderDtl.Character09 = "" then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

The problem is, on a delete, this exception message is popping up.
I threw other information messages in the loops to see if I could debug it but those do not pop up, which makes sense because it is a delete BUT the exception message IS popping up.

Assuming that everything else is good, is there a problem with how I am throwing the exception message?
And speaking of “throwing”, I don’t really know what “{&THROW_PUBLIC}.” Is used for.
I’ve seen example where this was used and other where it’s not used.






Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:d3fca0.png@beab755a.4b96e927]
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]
What About:

if ((ttOrderDtl.Character09 = "") AND (ttOrderDtl.RowMod <> "D")) then do: 
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"} 
{&THROW_PUBLIC}. 
end. 

Steven G.


On Tuesday, November 11, 2014 5:01 PM, "Joe Rojas jrojas@... [vantage]" <vantage@yahoogroups.com> wrote:


 
<div id="ygrps-yiv-1493391857yiv9615795819ygrp-text">
  
  
  <div>Hello,


We have a data directive on OrderDtl that runs custom code where the very first line is:

for each ttOrderDtl where ttOrderDtl.Company = cur-comp and (ttOrderDtl.RowMod = "A" or ttOrderDtl.RowMod = "U") and ttOrderDtl.kitFlag <> "C" and ttOrderDtl.OrderNum > 3181001 no-lock:

Ignoring the other criteria for a moment, the main part that is contributing to this “weirdness” is that you should only be in the for each loop if the row was updated or added.

There is a bunch of code in the loop but one particular snippet is:

if ttOrderDtl.Character09 = "" then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

The problem is, on a delete, this exception message is popping up.
I threw other information messages in the loops to see if I could debug it but those do not pop up, which makes sense because it is a delete BUT the exception message IS popping up.

Assuming that everything else is good, is there a problem with how I am throwing the exception message?
And speaking of “throwing”, I don’t really know what “{&THROW_PUBLIC}.” Is used for.
I’ve seen example where this was used and other where it’s not used.






Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:d3fca0.png@beab755a.4b96e927]
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]

</div>


Thanks for the reply Steven but this doesn’t address the main issue.
That code snippet shouldn’t even run if it’s a delete.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:3923fa.png@1d79d74a.43ade03e]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 12:52 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] E9: Weird Data Directive Behavior


What About:

if ((ttOrderDtl.Character09 = "") AND (ttOrderDtl.RowMod <> "D")) then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

Steven G.

On Tuesday, November 11, 2014 5:01 PM, "Joe Rojas jrojas@... [vantage]" <vantage@yahoogroups.com> wrote:


Hello,

We have a data directive on OrderDtl that runs custom code where the very first line is:

for each ttOrderDtl where ttOrderDtl.Company = cur-comp and (ttOrderDtl.RowMod = "A" or ttOrderDtl.RowMod = "U") and ttOrderDtl.kitFlag <> "C" and ttOrderDtl.OrderNum > 3181001 no-lock:

Ignoring the other criteria for a moment, the main part that is contributing to this “weirdness” is that you should only be in the for each loop if the row was updated or added.

There is a bunch of code in the loop but one particular snippet is:

if ttOrderDtl.Character09 = "" then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

The problem is, on a delete, this exception message is popping up.
I threw other information messages in the loops to see if I could debug it but those do not pop up, which makes sense because it is a delete BUT the exception message IS popping up.

Assuming that everything else is good, is there a problem with how I am throwing the exception message?
And speaking of “throwing”, I don’t really know what “{&THROW_PUBLIC}.” Is used for.
I’ve seen example where this was used and other where it’s not used.






Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:d3fca0.png@beab755a.4b96e927]
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]
What’s also weird is if I change it from PublishEx.i to PublishInfoMsg.i
It seems to work ok but then I noticed that my delete is being processed as an Update.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:676eeb.png@34813bb8.4eb0bcb1]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 1:54 PM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] E9: Weird Data Directive Behavior



Thanks for the reply Steven but this doesn’t address the main issue.
That code snippet shouldn’t even run if it’s a delete.





Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:3923fa.png@1d79d74a.43ade03e]
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.


From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 12, 2014 12:52 PM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] E9: Weird Data Directive Behavior


What About:

if ((ttOrderDtl.Character09 = "") AND (ttOrderDtl.RowMod <> "D")) then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

Steven G.

On Tuesday, November 11, 2014 5:01 PM, "Joe Rojas jrojas@... [vantage]" <vantage@yahoogroups.com> wrote:


Hello,

We have a data directive on OrderDtl that runs custom code where the very first line is:

for each ttOrderDtl where ttOrderDtl.Company = cur-comp and (ttOrderDtl.RowMod = "A" or ttOrderDtl.RowMod = "U") and ttOrderDtl.kitFlag <> "C" and ttOrderDtl.OrderNum > 3181001 no-lock:

Ignoring the other criteria for a moment, the main part that is contributing to this “weirdness” is that you should only be in the for each loop if the row was updated or added.

There is a bunch of code in the loop but one particular snippet is:

if ttOrderDtl.Character09 = "" then do:
{lib/PublishEx.i &ExMsg = "'No Charge Reason is Required.!'"}
{&THROW_PUBLIC}.
end.

The problem is, on a delete, this exception message is popping up.
I threw other information messages in the loops to see if I could debug it but those do not pop up, which makes sense because it is a delete BUT the exception message IS popping up.

Assuming that everything else is good, is there a problem with how I am throwing the exception message?
And speaking of “throwing”, I don’t really know what “{&THROW_PUBLIC}.” Is used for.
I’ve seen example where this was used and other where it’s not used.






Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 37 Shuman Ave | Stoughton | Ma | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

[cid:d3fca0.png@beab755a.4b96e927]
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]