"An item with the same key has already been added" error when creating custom Aif document (TSTimesheetTable, TSTimesheetLine, TSTimesheetLineWeek)

“An item with the same key has already been added” error when creating custom Aif document (TSTimesheetTable, TSTimesheetLine, TSTimesheetLineWeek)

Hi there,

I am trying to create a custom Aif document to create timesheets incl. lines through the Excel Add in. I created one before (item forecast) and it worked without any problems.
I works fine if I use only one data source (TSTimesheetTable). Unfortunately this time I get an error when adding the second data source to the query.
TSTimesheetTabel (Fields: TimesheetNbr, ApprovalStatus, PeriodFrom, PeriodTo, PostStatus, SourceDocumentHeader, Worker)
→ TSTimesheetLine (Fields: ActivityNumer, TimesheetNbr (Relation to TSTimesheetTable))

Has anybody experienced a problem like this and was able to solve it? For SSRS reports I read that this could have something to do with the same field names which can’t be the reason here because other Aif documents use the same field name in different data source.

I would really appreciate if you can point me into the right directions. We use Ax 2012 R2 CU7.

Thanks,
Mathias

By the way, this worked through the File System Adapter but not through the Excel Add In. I thought it might has something to do with the service “TimesheetServices” but it’s deactivated.