Type exists in multiple BO references

I’ve written a method directive on QuoteImpl.CreateOrder post that uses three different BOs: SalesOrder, BomSearch, and PartPlantSearch. “Check syntax” reports no problems. But when I enable and save, I get several compilation errors about types existing in more than one BO reference, as well as BOs not implementing the correct interfaces. All the issues are related to some “ETC Validation” thing, but there may be multiple separate issues here. I’ll try to isolate them.

Has anyone else run into this?

Server Side Exception

There is at least one compilation error.
CustomizationAdapter.cs(384,100): error CS0433: The type 'ETCAddrValidationTableset' exists in both 'Erp.Contracts.BO.Quote, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992' and 'Erp.Contracts.BO.SalesOrder, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992'
CustomizationAdapter.cs(389,30): error CS0433: The type 'ETCAddrValidationTableset' exists in both 'Erp.Contracts.BO.Quote, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992' and 'Erp.Contracts.BO.SalesOrder, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992'
CustomizationAdapter.cs(9,132): error CS0738: 'QuoteSvcCustomization' does not implement interface member 'QuoteSvcContract.ETCValidateAddress(int, int, out bool, out bool, out string)'. 'QuoteSvcCustomization.ETCValidateAddress(int, int, out bool, out bool, out string)' cannot implement 'QuoteSvcContract.ETCValidateAddress(int, int, out bool, out bool, out string)' because it does not have the matching return type of 'ETCAddrValidationTableset'.
CustomizationAdapter.cs(9,132): error CS0535: 'QuoteSvcCustomization' does not implement interface member 'QuoteSvcContract.ETCAfterAddressValidationOTS(ref QuoteTableset, ETCAddrValidationTableset, int)'
CreateOrder.CommonTypes.cs(167,55): error CS0433: The type 'QuoteQtyRow' exists in both 'Erp.Contracts.BO.Quote, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992' and 'Erp.Contracts.BO.SalesOrder, Version=11.1.100.0, Culture=neutral, PublicKeyToken=5d3fa3c7105d7992'

Exception caught in: Epicor.ServiceModel

Yep.

Search results for ‘the type exists in both’

Yikes! Looks like someone just copy-pasted a bunch of types all over the place instead of having the BOs reference a common library. :weary:

I’m only updating through one BO, so maybe I’ll embrace evil and read directly from the DbContext.

Double whammy… the same conflict occurs between the only BO used in a BPM and the BO the BPM is on. So for example, you can’t use the SalesOrder BO on a BPM on any Quote method. Aargh!

I don’t think it was a copy/paste thing as much as a design decision that didn’t take this eventuality into consideration. I saw it first with the Serial Number table.

I think I’ve seen people get around it by call Epicor Functions which would then separate out the different objects. But someone else would have to chime in on that.

That works. I was able to use the SalesOrder BO in an EF invoked from a method directive on Quote.CreateOrder post.

1 Like