I have an out of the box entity that I've extended to include modified and created by fields. If a record existed before turning on the fields it's filled with a '?' and the customer doesn't want question marks in the output file, either the name or blank. In custom entities I had no problem adding code to the postLoad() method to change the '?'s to blank strings, but it's when I tried extending the out of the box entities.
An example here (shown below) https://community.dynamics.com/365/financeandoperations/b/365finopsknowledge/posts/how-to-extend-or-overwrite-dataentity-methods-in-d365-finance-and-operations-x is not working for me, the extended code is never hit when running the entity. I also tried using dataEntityViewStr isntead of tableStr for the extensionOf, neither are working.
Is this possible?
[ExtensionOf(tableStr(SalesOrderHeaderV2Entity))]
final class SWClass_SalesOrderHeaderV2Entity_Extension
{
public void postload()
{
next postload();
SalesOrderHeaderV2Entity SalesOrderHeaderV2Entity = this;
SalesTable salesTable = SalesTable::find(SalesOrderHeaderV2Entity.SalesOrderNumber);
SalesOrderHeaderV2Entity.customdate += date2Str(salesTable.createddateandtime, 213,
DateMonth::Digits2,
DateSeparator::Slash,
DateDay::Digits2,
DateSeparator::Slash,
DateYear::Digits4);
}
}
}