Method rules running during a configuration? E10.1.500

Hi,

I always thought Method Rules ran only at “get details” time, but I am questioning that.

I unknowingly introduced an infinite loop within a Method Variable (in Method rules) while modifying the variable’s code. When I went to test the configuration it would hang in the configuration–before going back to the quote to get details.

During the configuration on this configurator, you click the “configure” button, let all the UD methods have their way, and then navigate to the final page to save the configuration and go back to the quote.

In this instance, the configure code would all run fine, but when I clicked on the arrow to move to the last page it would never finish going there. (It takes a while to go to the last page in any case.)

Once I fixed the loop in the method rule everything worked. I reintroduced the error and it hung again.

I also saw this where Epicor complained it couldn’t explode a bad phantom part during the configuration at this same point.

I thought the method rules had been separated from the configuration, but it looks like it at least tests the method rules during the configuration.

Any thoughts?

Thanks,

Joe

Hi Joe,

The method variables do also run at time of saving the quote/order configuration. If you have method rules or method variable code that you only want to run during get details you can enclose the code in the following condition.

if (Context.JobNumber != “”)
{

}

Thanks,

Roger Bomford

Good deal. Thanks.

For reasons unknown, method rules may run before On Page Leave is executed. Testing what the target entity is does not help in this case.

My workaround was to set a hidden checkbox when On Page Leave runs, and clear it in On Page Loaded in case leave is called by navigating backward. Rules can test this input to determine if they’re running in Get Details after the configuration was saved.

Still trying to get support to understand why it’s wrong for method rules to run before OnPageLeave expressions. But they directed me to an unrelated PRB that I wasn’t even aware of. Apparently when method rules run after OnPageLeave, they sometimes run in the wrong order.

Is any part of the configurator not horrendously broken?

Sorry in advance for reviving the dead topic, but I finally fixed my issue related to this and wanted to post in case someone else is searching later:

We have a website that creates orders for configured parts in Epicor via API. These online orders probably could populate configuration inputs, but we found it was much easier to put the values into User Defined columns on the OrderDtl_UD table. The Document Rules processed just fine, but the Method Rules are where we ran into issues.

At first I was able to solve the issue by adding a linq query to each rule action, but as we offered more products, more rules and rule actions were needed, and eventually there were too many queries. I tried just adding the query to a Method Variable, and then returning the values as ‘~’-separated string, which could then be split into an array and all the values accessed.

This seemed to fail and return a blank string every time. Moreover, it broke the non-online orders, because the method variable tried to process before the configuration saved, and the input values were not yet added to the OrderDtl table. It was trying to execute the Method Rules before the configuration save or the OnPageLeave script.

The solution was to build my ‘~’-separated string in the method variable based only on inputs. Then in the Method Rule Action of the first Operation on the Bill of Operations, call my LINQ query and then build my ~-string, and re-set the method variable to that. I’m not 100% sure why it doesn’t work adding the query direction in the method variables module, but works every time within the Rule Action, but it seems reliable.