Configurator: Check if entered part is valid

I am working on a configurator in the latest version of Epicor Kinetic, and I need help checking if a part/material entered into the configurator menu is valid, and to send a warning/message if it is not valid.

My configurator is set up to read certain fields from the quote detail section and populate it into fields in the configurator after a button is pressed. The populated configurator field (named material) then checks the part details and populates all the fields that are needed in the configurator. The information for the part is populated by a UD method.


An issue that is occurring is that if a part has a typo or is not in the database, there is nothing that alerts the user. Is there a way to do this? I looked at using a condition and dialog-show action, but I have no idea how to make that check if a configurator field is actually in the database.

I can’t speak to doing it within Configurator, but there is a PartExists method on Erp.BO.PartSvc.

I’m assuming you could add a kinetic-rest call in your button click event to validate if a part exists… if fails, pop-up a message.

1 Like

On, there’s also an Erp.BO.ConfigurationRuntimeSvc with a PartExists method.

So the rest-kinetic part.partexists seems to almost be the solution, but I am not seeing a way to make the dialog-show action work only if the rest-kinetic action is a failure. The connector to dialog-show only has success, error, and empty. I tried both error and empty, and neither of those seemed to work if the part is not valid.

Looks like the PartExists returns (returnObj) a boolean. Not sure if that boolean value would be stored in the actionResult dataview?? Perhaps you could bounce that off of a condition?

You could also try PartSvc’s GetByID method. That should definitely fail/error if the ID doesn’t exist.

Yeah, the result should comeback in actionResult.returnObj

So, you could use a condition (on success) of the rest call, if actionResult.returnObj is false… dialog show.

Tried PartSVC GetByID, and that seems to always return an error even if the part is valid. I will try the condition

EDIT:
I should probably post the error

1 Like

It says it’s missing a parameter. Are you passing the PartNum in as a parameter in your PartExists call?

If your PartExists method is causing an error you can’t run down, you could just throw a server side UD Method in the Configurator with a Linq Query:

bool PartExists = Db.Part.Any( x => x.PartNum == Inputs.txtPartNum.Value );
2 Likes

I totally forgot to put a field value in the method parameters in the rest-kinetic action. That is why it kept erroring!