web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error in file while reading in record - Filename too long

(0) ShareShare
ReportReport
Posted on by

Hello,

I have some custom code which occasionally gives me the following error in a message box:

Error in file: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\$tmp00030000.$$$ while reading in record = 50000860

Windows error: =

Error code: 38 = Filename too long

Try again?

Yes/No

No matter how many times I choose the Yes option, the error keeps coming back.  If I choose the No option, then I get an error in the infolog:

Cannot edit a record in MyTable (MyTable).  The record has been deleted by another user.

The strange thing is that if I try to run my custom code a second time, it almost always works.  It seems that I only get this error on the first time that I run the custom code after opening AX.  Subsequent runs work fine.  Additionally, if i close and reopen my AX client then I will get the error again on the first time that I run my code. 

The table that's being updated is not a temporary table.  I'm wondering why this error would occur at all and also why doesn't it occur consistently.  Why would it only give this strange windows error about the file name being too long on the first try but not on additional tries?

Is there any way to set the temp folder that AX is writing to an alternate location (maybe C:\Temp\) so that the folder name is shorter and hopefully i won't run into this error again?  Any other suggestion on dealing with this issue would be greatly appreciated!

Thanks,

Adam

*This post is locked for comments

I have the same question (0)
  • user5555 Profile Picture
    7,435 on at
    Re: Error in file while reading in record - Filename too long

    right click on your 'my documents' folder and specify the path. This is maybe a solution to your problem.

    J.

  • Greg's Mom Profile Picture
    on at
    Re: Error in file while reading in record - Filename too long

    Hi, thanks for the suggestion.  I tried moving the My Documents folder as you suggested but it only moved the My Documents and not the entire documents and settings folder.  I'm still getting the error bu again, only on the first time that I run the code.  On subsequent runs, it works fine.

  • Verified answer
    Community Member Profile Picture
    on at
    Re: Error in file while reading in record - Filename too long

    Right. I had exactly this error message, and it had nothing to do with the length of the Documents and Settings path. It has taken me 3 solid days of searching, but I solved it - in my case, at least.

    I was working with ProjTable, and in the project create wizard it sets the datasource to temporary using .setTmp() so that it can provide a temporary list of projects that will be created, and let them be edited, without committing anything to the database yet.

    I added some code to validateWrite to do some extra validation for our customer, and I needed to make sure that it didn't fire when modifying these temporary "projects", so I intended to put "if (!this.isTmp())" in front of it.

    Unfortunately I had mis-typed, and put setTmp instead of isTmp. This set the temporary flag in the middle of validation, so when AX tried to save the record it tried to send it to a temp file instead of the database. Unfortunately there was not temp file (obviously) so it generated the totally misleading message about the path being too long in the temp folder.

    Hope that gives you some more clues to look out for, Adam.

  • Greg's Mom Profile Picture
    on at
    Re: Error in file while reading in record - Filename too long

    Thank you so much, that's awesome that you were able to figure that out.  I gave up searching for the issue to this problem but now I can go back and fix it.  Thanks again!

  • tudorbin Profile Picture
    5 on at
    RE: Error in file while reading in record - Filename too long

    For such problems, you can use Long Path Tool, it works fine.

  • Community Member Profile Picture
    on at
    RE: Error in file while reading in record - Filename too long

    Long Path Tool helped me in this situation.

  • Fred_Davis Profile Picture
    10 on at
    RE: Error in file while reading in record - Filename too long

    Use Long Path Tool, Long Path Tool can simplify and

    probably end your problems in unlocking, managing and

    renaming files that appear to have a long filename.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans