Method Directive - Not always firing

Hi All,

I don’t usually post but I’m stumped by this issue I’m having.
Im on Epicor 10.0.700.4
All my users are on one apppool.

This seems so simple, yet it doesn’t always fire in my production environment.

The idea is I want to copy the value from OrderComment from OrderDtl and then insert it into the WarrantyComment field when a user adds/save a comment.

In my test environment, the method fires 100% of the time and I tried all sorts of ways to try and find bugs but every time the data is copied over correctly.

Yet in production it copies it 20% of the time.

Here is my method.
In Pre-Processing of ERP.SalesOrder.Update
the condition is pretty basic.
If the field OrderComment has been changed from “” to another.
from empty to anything else.

My understanding is that the OrderComment field cannot be null but is empty so technically my method should fire every time someone enter a brand new comment.

Fire the set field.
Set the ttOrderDtl.WarrantyComment field of the updated row to the ttOrderDtlRow.OrderComment

I also tried the same thing with a data Directive and I have the same results.

Then I go check via SSMS, and I see that the OrderComment field has a value and the WarrantyComment field doesn’t.

I’m I doing this right?

This will only work for updated records. Are you sure you are not creating a new OrderDtl record, then updating the OrderComment, and then saving the OrderDtl? If that is the case you also need to add a condition for Added records and in your Set Field change “the updated row” to “the changed row”.

1 Like

@Brian is correct… your condition should also have an “OR” looking for an ADDED record. That way if someone puts the comment while they are adding a new line item, it will also be processed.

Thank you @Brian and @timshuwy
You were right, I wasn’t capturing all the options, the added/updated/changed rows.

mRemoteNG_5e90UAy9Bd

It’s not pretty but now I have a condition for all three types of set field.

I had an issue with the added row, it still wouldnt fire if ttOrderDtlRow.OrderComment is not equal to “”

Now it’s working like I need it to.

For any new line thats being created and not yet saved, the added condition is as follow.


The WarrantyComment field of the addedRow is not equal to ttOrderDtlRow.OrderComment being empty.
So if my ordercomment isn’t empty and my warranty is. it pushes the OrderComment Value into the warrantyComment field.

Other Scenario,
If I create a new line, hit save then add an ordercomment, the update condition fires and it writes it’s value into warrantyComment field.

Other Scenario,
If I go into an existing line with a comment and modify it from a value to another, nothing fires.
This is what I wanted.

If I remove the comment, it becomes empty, I hit save and then add a brand new comment. The Method fires again.

Now to push it into production !

1 Like