Difference between

Hi,

i have a question. What is the difference between Data Directive Maintenance (in transaction) and Methode Directive Maintenance (Post Processing)?

and witch one i use if the bot directive is good?

thanks

You may need a bit more detail in your question to get a useful answer.

Method directives are used to link to a BO method. Then take some action based on the method. If you want to do something before the method use a pre-processing directive. If you want to do something after the method, use the post. Do not use the base method, as it will replace the base epicor method with whatever you put in there.

The Data directives are used to link to a change on a database table. If you want to do something after your data is updated in the database, use this.

What do you want to do that may need a directive?

2 Likes

Also, if you use a Data Directive to change a table field, that change will not hit the change log or have any trail of what happened. Pretty scary.

Data directives are safer when you use them to warn or stop an action you don’t want the user to do. Then, who cares if there’s a log of that? But some discourage even this, for performance reasons, for example.

2 Likes

That’s like the first thing I think about is performance because as I understand it a data directive will always be ran every time a table is hit. Whereas a business object method is ran from a distinct call.

1 Like

Counterargument: Having one data directive can take the place of multiple method directives. Example: PartRev can be touched by multiple methods within more than one module. Having said that, I usually use data directives to set UD fields. I maybe have two that touch stock data and all of them are pretty simple. You don’t want something too elaborate here.

3 Likes

Thanks for expanding on that John, yes that’s a good use case if you need to always do something at the table level, but if you ONLY need to do something at the point a certain business object was called.