BPM to Raise Exception based on difference between 2 dates

Thanks Jose, that sorted the issue in the Sales Order

I tried adding the RowMod into the JobHead code and it made no difference, regardless of what I date I put in to the required by field it shows the defined error message. I think the way the Job Head table is saved is causing the issue.

Would you be able to look a this as well please?

The code for the job is.

FOR EACH ttJobHead where (ttJobHead.RowMod='A' OR ttJobHead.RowMod='U')AND ttJobHead.JobNum MATCHES '*N*' or ttJobHead.JobNum Matches '*TEA*'or ttJobHead.JobNum Matches '*E*' or ttJobHead.JobNum Matches '*S*' or ttJobHead.JobNum Matches '*SW*' or ttJobHead.JobNum Matches '*W*' or ttJobHead.JobNum Matches '*SE*' AND ABSOLUTE(INTERVAL(ttJobHead.CreateDate, ttJobHead.ReqDueDate, 'days')) < 365:
   {lib\PublishEx.i &exMsg = "'ReqByDate must be 1 year from today'"}
   {&THROW_PUBLIC}.
END.


Hello


I would like to be able to prevent a sales order header from being saved if the timescale between the OrderHed.OrderDate and OrderHed.RequestDate (ShipBy) is less than 365 days and OrderHed.ShortChar01 contains the word Machine.


I have no idea how to write the 4GL Code to implement this.


The reason for this is that for our scheduling to work these sales orders are make to order and we do not want MRP to create planned orders for them in the immediate future, we have determined that the RequestDate (ShipBy) determines how the job will be scheduled. By making it 12 months away MRP will not create planned orders that affect anything now. We have MPS's in place for specific components that make up these orders.


I would appreciate any help that can be offered by the group.


We are on Vantage 410 Progress


Many thanks

Mark Lawrence

You don’t really need 4gl to do what youre looking for, the method directive wizards/templates are all there for that. Create a method directive on SalesOrder.Update, preprocessing. Two conditions joined with ‘and’ the first use the option the specified field on the changed row is equal to the specified expression, where field is OrderHed.ShortChar01 and the expression is ‘Machine’. The second used the exact same option with field being OrderHed.OrderDate and the expression is Add-interval(Today, 365, ‘days’). Your action will be raise exception based on the designed template.

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 18, 2015 5:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM to Raise Exception based on difference between 2 dates



Hello



I would like to be able to prevent a sales order header from being saved if the timescale between the OrderHed.OrderDate and OrderHed.RequestDate (ShipBy) is less than 365 days and OrderHed.ShortChar01 contains the word Machine.



I have no idea how to write the 4GL Code to implement this.



The reason for this is that for our scheduling to work these sales orders are make to order and we do not want MRP to create planned orders for them in the immediate future, we have determined that the RequestDate (ShipBy) determines how the job will be scheduled. By making it 12 months away MRP will not create planned orders that affect anything now. We have MPS's in place for specific components that make up these orders.



I would appreciate any help that can be offered by the group.



We are on Vantage 410 Progress



Many thanks

Mark Lawrence



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

Hi Rob

Thanks for your reply

I have tried your suggestion but i do not have the option in pre-processing  "The specified field on the changed row is equal to the specified expression" i only have "the specified field on the changed row is equal to the specific value"

I notice that your option is in ERP10 ( we are testing 10) and probably in 9 but it appears not to be in Vantage

Regards

Mark



---In vantage@yahoogroups.com, <rbucek@...> wrote :

You don’t really need 4gl to do what youre looking for, the method directive wizards/templates are all there for that. Create a method directive on SalesOrder.Update, preprocessing. Two conditions joined with ‘and’ the first use the option the specified field on the changed row is equal to the specified expression, where field is OrderHed.ShortChar01 and the expression is ‘Machine’. The second used the exact same option with field being OrderHed.OrderDate and the expression is Add-interval(Today, 365, ‘days’). Your action will be raise exception based on the designed template.

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 18, 2015 5:07 AM
To: vantage@yahoogroups.com
Subject: [Vantage] BPM to Raise Exception based on difference between 2 dates



Hello



I would like to be able to prevent a sales order header from being saved if the timescale between the OrderHed.OrderDate and OrderHed.RequestDate (ShipBy) is less than 365 days and OrderHed.ShortChar01 contains the word Machine.



I have no idea how to write the 4GL Code to implement this.



The reason for this is that for our scheduling to work these sales orders are make to order and we do not want MRP to create planned orders for them in the immediate future, we have determined that the RequestDate (ShipBy) determines how the job will be scheduled. By making it 12 months away MRP will not create planned orders that affect anything now. We have MPS's in place for specific components that make up these orders.



I would appreciate any help that can be offered by the group.



We are on Vantage 410 Progress



Many thanks

Mark Lawrence



[Non-text portions of this message have been removed]
 
 
I was speaking to E9. We are live on 700c

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Wednesday, November 18, 2015 9:01 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BPM to Raise Exception based on difference between 2 dates




Hi Rob

Thanks for your reply

I have tried your suggestion but i do not have the option in pre-processing "The specified field on the changed row is equal to the specified expression" i only have "the specified field on the changed row is equal to the specific value"

I notice that your option is in ERP10 ( we are testing 10) and probably in 9 but it appears not to be in Vantage

Regards

Mark



---In vantage@yahoogroups.com, <rbucek@...> wrote :
You don’t really need 4gl to do what youre looking for, the method directive wizards/templates are all there for that. Create a method directive on SalesOrder.Update, preprocessing. Two conditions joined with ‘and’ the first use the option the specified field on the changed row is equal to the specified expression, where field is OrderHed.ShortChar01 and the expression is ‘Machine’. The second used the exact same option with field being OrderHed.OrderDate and the expression is Add-interval(Today, 365, ‘days’). Your action will be raise exception based on the designed template.

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...<mailto:rbucek@...>
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>]
Sent: Wednesday, November 18, 2015 5:07 AM
To: vantage@yahoogroups.com<mailto:vantage@yahoogroups.com>
Subject: [Vantage] BPM to Raise Exception based on difference between 2 dates



Hello



I would like to be able to prevent a sales order header from being saved if the timescale between the OrderHed.OrderDate and OrderHed.RequestDate (ShipBy) is less than 365 days and OrderHed.ShortChar01 contains the word Machine.



I have no idea how to write the 4GL Code to implement this.



The reason for this is that for our scheduling to work these sales orders are make to order and we do not want MRP to create planned orders for them in the immediate future, we have determined that the RequestDate (ShipBy) determines how the job will be scheduled. By making it 12 months away MRP will not create planned orders that affect anything now. We have MPS's in place for specific components that make up these orders.



I would appreciate any help that can be offered by the group.



We are on Vantage 410 Progress



Many thanks

Mark Lawrence



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





[Non-text portions of this message have been removed]
Is it possible to do this in Vantage with some coding?  We are not moving to Epicor 10 for at least 18 Months so this would be really useful at the moment.

thanks

Mark
Not knowing any specifics about what process you are monitoring, I’d say most likely yes.

Rob Bucek
Production Control Manager
D&S Manufacturing
301 E. Main St. | PO Box 279
Black River Falls, WI 54615
715-284-5376 Ext. 311
Mobile: 715-896-3119
rbucek@...
www.dsmfg.com<http://www.dsmfg.com>

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Thursday, November 19, 2015 2:33 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] BPM to Raise Exception based on difference between 2 dates



Is it possible to do this in Vantage with some coding? We are not moving to Epicor 10 for at least 18 Months so this would be really useful at the moment.

thanks

Mark



[Non-text portions of this message have been removed]
Sure you can just write a custom 4GL Statement to do this
FOR EACH ttOrderHed where ttOrderHed.ShortChar01 MATCHES '*Machine*' AND ABSOLUTE(INTERVAL(ttOrderHed.OrderDate, ttOrderHed.RequestDate, 'days')) > 365:
  {lib\PublishEx.i &exMsg = "'MY ERROR HERE'"}
  {&THROW_PUBLIC}.
END.




Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Thu, Nov 19, 2015 at 3:32 AM, teaglem@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Is it possible to do this in Vantage with some coding?  We are not moving to Epicor 10 for at least 18 Months so this would be really useful at the moment.</p><div><br></div><div>thanks</div><div><br></div><div>Mark</div><p></p>

</div>
 


<div style="color:#fff;min-height:0;"></div>

Brilliant, works a treat

Many thanks Jose

Mark Lawrence

Ok I think I spoke too soon.

It works well on new orders but if you go back to a previous order and say add a comment to the header it throws up message about the dates but then ignores any date you enter thus preventing saving of the order. I think the message about updating the release lines with the new Shipdates is causing the issue.

I have tried this in Job Entry as well where we have jobs prefixed by certain letters that need the same rule applied between the JobHead.createdate and JobHead.ReqDueDate. The rule is triggered correctly based on the job prefixes but the message pops up about the date regardless of what date is entered.

these are being entered in to SalesOrder,Update and JobEntry.Update as Pre-Processing methods.

Thanks

Mark
Try adding RowMod
FOR EACH ttOrderHed where (ttOrderHed.RowMod='A' OR ttOrderHed.RowMod='U') AND ttOrderHed.ShortChar01 MATCHES '*Machine*' AND ABSOLUTE(INTERVAL(ttOrderHed.OrderDate, ttOrderHed.RequestDate, 'days')) > 365:
  {lib\PublishEx.i &exMsg = "'MY ERROR HERE'"}
  {&THROW_PUBLIC}.
END.


Jose C Gomez
Software Engineer


T: 904.469.1524 mobile

Quis custodiet ipsos custodes?

On Fri, Nov 20, 2015 at 6:10 AM, teaglem@... [vantage] <vantage@yahoogroups.com> wrote:

Â
<div>
  
  
  <p>Ok I think I spoke too soon.</p><div><br></div><div>It works well on new orders but if you go back to a previous order and say add a comment to the header it throws up message about the dates but then ignores any date you enter thus preventing saving of the order. I think the message about updating the release lines with the new Shipdates is causing the issue.</div><div><br></div><div>I have tried this in Job Entry as well where we have jobs prefixed by certain letters that need the same rule applied between the JobHead.createdate and JobHead.ReqDueDate. The rule is triggered correctly based on the job prefixes but the message pops up about the date regardless of what date is entered.</div><div><br></div><div>these are being entered in to SalesOrder,Update and JobEntry.Update as Pre-Processing methods.</div><div><br></div><div>Thanks</div><div><br></div><div>Mark</div><p></p>

</div><span class="ygrps-yiv-1781474812">
 


<div style="color:#fff;min-height:0;"></div>