Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

(0) ShareShare
ReportReport
Posted on by 55

Hi, I am following this blog to do some test, when I am at select for the LogisticsEntityPostalAddressView I got this error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'. What is this about and how can I solve this?

pastedimage1625541719335v1.png

  • MinhPham96 Profile Picture
    MinhPham96 55 on at
    RE: Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

    Hi, I was able to get the function to run when I full sync, but it only ran once and the issue happened again, but I was able to review the code and see that it does not work, so I rewrote a new one without using the error View

    str storeNumber = 'ANNAPOL';
    str email = "";
    RetailStoreTable retailStoreTable;
    OMOperatingUnit operatingUnit;
    DirPartyLocation dirPartyLocation;
    LogisticsElectronicAddress  electronicAddress;
    
    select firstonly retailStoreTable where retailStoreTable.StoreNumber == storeNumber;
    
    select firstonly electronicAddress
        where electronicAddress.Type == LogisticsElectronicAddressMethodType::Email
        exists join dirPartyLocation
            where dirPartyLocation.Location == electronicAddress.Location
        exists join operatingUnit
            where operatingUnit.RecId == dirPartyLocation.Party
        && operatingUnit.RecId == retailStoreTable.OMOperatingUnitID;
    
    email = electronicAddress.Locator;
    
    Info(strFmt("%1", email));

  • MinhPham96 Profile Picture
    MinhPham96 55 on at
    RE: Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

    Hi, I tried to rebuild and sync again, and the disk space is not full, but the problem is not resolved. This only happens for this query though, I do not have this problem with other queries

  • Suggested answer
    Rachit Profile Picture
    Rachit 4,015 User Group Leader on at
    RE: Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

    Try to do a full model build followed by DB sync on your DEV VM and try again.

    Also check the disk space on your VM.

  • MinhPham96 Profile Picture
    MinhPham96 55 on at
    RE: Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

    I am using D365FO

  • Ludwig Reinhard Profile Picture
    Ludwig Reinhard Microsoft Employee on at
    RE: Error: System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

    Hi,

    Are you operating AX2012 or D365FO?

    Best regards,

    Ludwig

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans