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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Error - Object reference not set to an instance of an object on creating the new customer address

(1) ShareShare
ReportReport
Posted on by 203
Hi ,
I have added few custom fields to my customer address form like region, zones etc. After creating the new address, irrespective of the new fields used or not its throwing the error of object reference not set to an instance of an object . On degubbing I found the error is in DirPartyPostalAddressView class in find method. As it hit the slect statement it throws error. 
public static DirPartyPostalAddressView find(DirPartyRecId _party, LogisticsLocationRecId _location, utcdatetime _validFrom = DateTimeUtil::utcNow(), utcdatetime _validTo = _validFrom)
    {
        DirPartyPostalAddressView postalAddressView;

        select firstonly postalAddressView
            where postalAddressView.Party == _party &&
                  postalAddressView.Location == _location &&
                  postalAddressView.ValidFrom <= _validFrom &&
                  postalAddressView.ValidTo >= _validTo;

        return postalAddressView;
    }
I can figure it out some problem is there in view, but cannot rectify what is the error.  Please suggest what can I see to check for the error. 
Please note I have added the code , if it's not visible then please check the below screenshot. I get error at line 282.
I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    239,118 Most Valuable Professional on at
    It doesn't makes sense, so maybe your code doesn't match the application (and therefore you're getting wrong information about where the error is thrown from). Please recompile the application.
     
    Is it about AX 2012? If so, check whether the code runs in X++ or CIL. If CIL, rebuild CIL too.
  • Raj Borad Profile Picture
    1,562 on at
    Hi,
     
    From Screenshot, it looks like F&O not AX.
    In AX, Many times I also faced the issue that the changes may is not reflecting as per code. I usually generate Incremental CIL to check the changes in the system.
    You can try It. Or Generate Full CIL.
     
     
  • Verified answer
    spidey1010 Profile Picture
    203 on at
    Hi, 
    The full model build and synch helped in resolving this issue. Thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 733

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 461 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 278 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans