I need to add a new enum to PriceType. PriceType has Extensibile = TRUE. I added it without a problem to the PriceType.MyExtension. But PriceType also has a class for each base enum.
The following link is from 2017: docs.microsoft.com/.../pricing-app73
I copied class PriceTypeTradeAgreementMappingSales and changed it to. the header of my class looks as follow where CalcPriceSales is my new PriceType.
***
[PriceTypeFactory(PriceType::CalcPriceSales)]
final class PriceTypeTradeAgreementMappingCalcPriceSales extends PriceTypeTradeAgreementMappingSales
{
---
}
***
However when I go to trade agreement journals and add a new one with relation = CalcPriceSales and click on Lines, I get the error "PriceTypeTradeAgreementMapping::NewPriceTy has been incorrectly called".
So it definitely doesn't pick up my new class that is for the new base enum. I would have thought that the attribute PricetypeFactory would have linked it together with the inheritance from PricetypeTradeAfreementMappingSales. But it doesn't.
SysExtensionAppClassFactory.searchAndCacheClassInstanceBySysExtAttribute() returns the class name for the standard base enum: PriceSales in
var searchStrategy = _searchStrategy? _searchStrategy : SysExtAppClassSearchStratDepth::newForCacheKey(_baseClassName, [[_attrCacheKey]]);
var cachedResult = searchStrategy.search();
The above code at one point runs method: getClassFromSysExtAttribute which goes into the Else-part of isCacheSet. It doesn't run the useLegacyFactoryBehavior, but the "using (var lock = new SysProcessLock())". I just can't figure out how it chooses the class to return depending on the Pricetype.
Any help is much appreciated.