Missing Report Data Def calc fields fix 2022.2

Was getting an error that my custom AR report data def was missing a calculated field. I’m not sure if these are supposed to upgrade cleanly or what the deal is, but what I found was the following.

Back when I created the data def on 9 the duplicate report form was ARInvForm.
As of today on 10.2.600 the name of the base form is ARForm, no longer the same.
As of 2022.2 the name of the base form is ARInvoice, no longer the same as 10.

I’m guessing if any automatic update stuff would occur it would need to see the duplicate of to add calc fields to your custom reports.

At any rate if you are getting errors like these in your system monitor for custom report data defs

Copy the row data for the base report and insert it for your custom rdd. Or recreate it from scratch is the only thing I can think of. Some I would do that… the AR form not a chance.

INSERT INTO [EpicorUpgrade].[Ice].[RptCalcField] (
	[SystemFlag]) VALUES ('**Your custom rdd ID**', 'InvcHead', 'ERP', 'InvcHead', 'TotalAdvBillCred', 'TotalAdvBillCred', 'decimal', '->>>,>>9.99999', '0', '0', '0', '', '', '', '', '', '1');

The one above was one in particular going from 10.2.600 to 2022.2 that I ran into.

If you want to find your mismatched duplicates run the below query

SELECT r.RptDefID, r.RptDescription, d.RptDefID FROM Ice.RptDataDef r LEFT JOIN Ice.RptDataDef d ON r.DuplicateOf = d.RptDefID WHERE r.DuplicateOf <> '' 

For whatever reason I have a few, but AR Invoice was the main one where the “Duplicate of” field didn’t point anywhere.