Skip to main content

Notifications

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
    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
    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
    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
    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
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March 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... 294,118 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,866 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans