Resolve type using Customization Resolver

We are using the Epicor.Customization.EcfRuntime to create a Type Resolver, to dynamically create a type at, well, runtime. However, there is some inconsistent logic happening and I’m putting this out there while I work on it to see if anyone has encountered anything similar.

This is regarding CSF, namely AU and NZ functionality, so that’s what I’ll base this question around. With the following code, I am able to resolve the type to Epicor.Internal.EI.ARPayment_AU_ABA, however, it provides null for ARPayment_NZ_BNZ.

ICustomizationItemResolver<Type> resolver = EcfRuntime.Current.CreateTypeResolver(this.Db, "ElectronicInterface", null);
string fullyQualifiedClassName = string.Format($"{electronicInterfaceNamespace}.{Path.GetFileNameWithoutExtension(this.EFTHead.Program)}");
Type type = resolver.Resolve(this.Db, fullyQualifiedClassName);

Now if I use the filename instead, I have the opposite - my type is resolved to Epicor.Internal.EI.ARPayment_NZ_BNZ, however, null for ARPayment_AU_ABA.

ICustomizationItemResolver<Type> resolver = EcfRuntime.Current.CreateTypeResolver(this.Db, "ElectronicInterface", null);
Type type = resolver.Resolve(this.Db, Path.GetFileName(this.EFTHead.Program));

Has anyone experienced anything similar?

Cheers,

Dave.

Interestingly, while re-running the conversion workbench on an the system, this seemed to resolve the issue - it now correctly resolves the type based on the filename (ie. ARPayment_AU_ABA.cs / ARPayment_NZ_BNZ.cs).

Weird, but it works, so I’ll just smile and nod :slight_smile: