Change COO when PartType is Set to Manufactured

Good morning!

I’ve been attempting to set up a BPM on Part.ChangePartTypeCode. The BPM should be simple, since we only manufacture in the US I want to set the PartCOO to United States when a part is changed to PartTypeCode of “M”.

I have tried pretty much everything under the Setters category and none of them seem to be working. I’ve attempted to update the PartCOO.OrigCountry, Part.IsOrigCountryNum, and both at the same time, but nothing happens. Has anyone successfully attempted something similar?

I’ve never dabbled with this… but since PartCOO is its own table… do you need to incorporate a rest call… Erp.BO.PartSvc… GetNewPartCOO.

My thought is that if there is not a pre-existing COO, there’s nothing there to update.

I actually did think of that. I have a test part I’ve added Albania as the COO but still unable to make a change. Good recommendation though, I might try calling the GetNewPartCOO method and see if I can do anything there.

I am wondering though if the fields I mentioned are even the correct fields to be updating.

Edit:
I did attempt to update the table with a query in the GetNewPartCOO method and no luck.

I was going to play around with this… but I can’t even find how to assign a COO to a part. My list is blank. Do I have to turn on LOT Country of Origin in company config? That’s the only reference I can find to COO functionality in the help.

I wish I could tell you. I haven’t been able to find too much about COO online here or in documentation.

This is really the only reference to COO I see in our config.

Oooo… looks like I’m missing this on my Country set-up…

I think the problem is that the dropdown field (Country of Origin) is not pre-populated. When i create a BPM on the post method of ChangePartTypeCode and simply set the ISOriginCountryNum the dropdown field says None Selected. Funny thing is if you create a new item, open en close the dropdown first and then set Manufactured it does automatically set the right country name in the dropdown.

Does it really have to be visible directly after changing the Type or would the Update method be OK as wel? If yes, you can set the right Countrynum in the pre-method of Update. Epicor does a GetByID to your screen afterwards and you will have a country set.

Jordie, that would be fine if it works. I initially started with trying to set this up in the Update, UpdateExt, and MasterUpdate methods and I couldn’t even get a message to fire off after I set the condition of when Part.TypeCode is changed to “M”. It seemed to stop processing there every time.

I checked both Kinetic and the classic app and it seems to work fine here.

And that will update the PartCOO table as well?

yep, the Update does that automatically:

image

Well, thank you a ton Jordie! It is now working as I had hoped. Thanks also @dcamlin for chipping in!

Sorry I wasn’t more help, haha. I learned a bit while exploring, so, time well spent. I was working on a test BPM when I saw @Jordie chime in with a solution. So, glad you got where you needed to go!

Ok, so I’m doing this as well. and Setting the COO when the Type is set to ‘M’ is great, but I also want to clear the COO if the Type is ever changed to anything but ‘M,’ That is a bit more difficult because if I try to set the ISOrigCountryNum to zero or ISOrigCountry to blank I get an error ‘Must be a primary country of origin selected when any PartCOO records exist.’ The same error occurs if I try to set the Country of Origin to blank or zero manually.

So I figured I’d delete the COO records first, but when I run a trace and delete the COO record in Part Entry and review the trace I see no PartCOO records and all I can determine is that somehow that also sets the ISOrigCountryNum to zero… but it doesn’t actually delete it. So I don’t see anything in the Trace on how the PartCOO is getting deleted through the UI.

Also, I realized that if the Part Site (PartPlant)’ Source Type is changed then I’d want to set the COO as well…. for that matter If the Primary Supplier is set for a Purchased parts I’d think I should set the COO to whatever the Country is for the Supplier and/or the Supplier Purchase Point….

If anyone has any insights on this, I would appreciate it!