Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

POS cannot create a customer's shipping address

Posted on by 185

Good morning all.

I am facing a problem with POS on Dynamics AX R3 CU11. When creating a SO on POS, everything is fine until I want to create a new shipping address. The system lets me to fill everything in but says that Customer couldn't be saved centrally after hitting Save on the new shipping address.

I was digging into it and found out that it fails on finding the newly created address in the DirPartyPostalAddressView. Whatever is passed as parameters, this method always returns null as it cannot find the record. 

It's code is

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

At first, I suspected it's because some mismatch of UTC datetime and it is not returning the record because of it. But it did not work even when I removed the ValidFrom/ValidTo conditions. It just looks like the view is not getting materialised or the last created record is not getting there yet. (I even tried to commit any transaction before calling this method - no luck, the address is physically created but it is not getting into the view.)

And the strange thing - if I call the same method of RTS directly from a job in AX, it perfectly works (even with running it under the user of RTS web service). So it is happening only when it is physically called from the web service.

Call stack is basically:

DirPartyPostalAddressView.find (line 5)
DirPartyLocationEntity.createAddressForParty (line 36)
DirParty.createOrUpdatePostalAddress (line 28)
RetailTransactionServiceCustomer.createAddress (line 144)
RetailTransactionService.createAddress (line 80)

Thanks a lot for any help/ideas. 

*This post is locked for comments

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans