While I have developed a validator workflow in C#, but I do not know how to implement it in Epicor. The validator is being used in order to check if the Part Description is in accordance with some regulations I have set, when a new Part is added. I have navigated through BPM submenus like Method and Data Directives but I am not sure how to do it.
There are 2 main problems:
I don’t know how to call the input of the description.
I don’t know how to set Epicor to run through Validator every time a new part is added through console.
What is a validator workflow in C#? Is this a function? a program? a tool you wrote? just some code?
You’ll need to do a Method Directive in Part.Update and check the description there (pre processing)
I highly recommend you get familiar with / read the ICE Tools Guide and the Customization Guide in EpicWeb before continuing though it seems you aren’t familiar with the Epicor tooling at all that will get you a lot closer to your goal I believe.
I agree with Jose’s suggestions… but just to help you with where to start.
The easiest way (in my opinion) to familiarize yourself with Epicor’s bags of tricks
is to review how the method and data directives work. You will need to understand the order of execution of the different types of directives. If you want the user to be prompted and given an opportunity to correct, you’ll want to use a pre-processing method directive. If there is no need for the user to interact, you could also do it as an in-transaction data directive. This will allow you to throw an exception with a message and prevent the record from being saved. You would not want to use a post-processing method directive or a standard data directive, as those happen after the data is saved. Never use the base processing method directive (it will replace the default Epicor logic). If this applies to both new records and updated records, you will need to handle those situations in the directive.
BPM is your friend here… you can put your code inside a PRE PROCESSING BPM that is on the Part.Update method. You should also put a statement that makes it only run when the condition is a “new record” or the Part.Description changed from Any to Any. then put your C# code after that, and you can then throw an error if the description doesn’t follow the rules.
Thank you all for your responses. They were insightful and I found my solution.
I used a Condition block in Pre-Processing Method Directive, and used a custom code. I loaded my .dll in Server/Customization/Externals and added it as a reference. Then I was able to use my functions.
Furthermore I took the input entry via Variable block selecting the corresponding row, and stored it as “input” string variable.