Hi everyone,
I'm facing an issue when I'm trying to import a file through code for a custom data entity I've written to import journal lines in D365FO. When I use the same file to import manually through Data management, I works fine.
I have created a batch class that makes use of the FileUploadTemporaryStorageStrategy class. When I click browse and select a file, the OK button gets enables as the file gets uploaded. When I click OK, I get the following exception at the gives lines of code:
Microsoft.DynamicsOnline.Infrastructure.Components.SharedServiceUnitStorage.SharedServiceUnitNotFoundException was unhandled by user code
Message: An exception of type 'Microsoft.DynamicsOnline.Infrastructure.Components.SharedServiceUnitStorage.SharedServiceUnitNotFoundException' occurred in Dynamics.AX.ApplicationFoundation.2.netmodule but was not handled in user code
Additional information: Record for Id - 35K0RCAAF not found.
The lines of code where I hit it are:
else if (dataSource.Type == DMFSourceType::File && dmfDataSourceProperties.FileFormat == DMFFileFormat::EXCEL)
{
con = DMFXmlGeneration::excleMappingGeneration(fileId,_definitionGrpEntity.ExcelLookUp);
}
When I debug, I notice something strange:
Thanks in advance for any help on this.
Best regards,
Syed
*This post is locked for comments