web
You’re offline. This is a read only version of the page.
close
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

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Are you operating AX2012 or D365FO?

    Best regards,

    Ludwig

  • MinhPham96 Profile Picture
    55 on at

    I am using D365FO

  • Suggested answer
    Rachit Profile Picture
    4,015 User Group Leader on at

    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

    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

  • MinhPham96 Profile Picture
    55 on at

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

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans