Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

SharedServiceUnitNotFoundException when trying to import file for a custom data entity in D365FO

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans