Dear Expert,
I had one requirement to add financial tags to ExpenseJournaLineEntity for excel add-ins. So I created extension for the entity and added FinTag table as read-only data source to the entity. Also added DisplayValue field to the field list. and wrote resolveFinTag method same as LedgerJournalLineEntity and called it from insertEntityDataSource and updateEntityDataSource.
private void resolveFinTags(LedgerJournalLineEntity _entity, LedgerJournalTrans _ledgerJournalTrans) { if (FinTagFeature::isEnabled()) { _ledgerJournalTrans.FinTag = FinTagResolver::resolve(_entity.FinTagDisplayValue, _ledgerJournalTrans.Company); _ledgerJournalTrans.OffsetFinTag = FinTagResolver::resolve(_entity.OffsetFinTagDisplayValue, _ledgerJournalTrans.Company); } }
When I am trying to import data from excel add in, I am getting error for insert and update that /Matching record for read only data source 'FinTag' does not exists/. I tried everything including skipping validations on data entity, still it did not work.
However I observe one weird behaviour, If I change newly added data source read-only property to 'NO' and build the project and again change it back to Read-Only 'YES' and build project again then I do not get the error and data is inserted / Updated. I tried this with multiple development environment and its working. But I can not do it on sandbox or Production. Any Idea how to resolve it or any method where I can wrote some logic. Thanks!