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, ...
Answered

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

(1) ShareShare
ReportReport
Posted on by 183
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
    237,978 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,428 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
    183 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

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
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans