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, ...
Suggested Answer

LogisticsPostalAddress table is not returning any data even it exists in DB

(4) ShareShare
ReportReport
Posted on by 89
Hi,
I'm facing an issue in Dynamics 365 FO, I have a query that returns data from LogisticsPostalAddress in SQL as well as on table browser I can see the record, but when I apply the X++ query I do not get any record. Following is the detail of the work I'm doing.
 


On Table browsing I can see the record by applying filter on recID
 
 


But when I apply Same query in X++ in runnable class I'm not getting the record.
 
 
Categories:
  • Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
    Moved from MS Dynamics AX Form
  • Layan Jwei Profile Picture
    8,421 Super User 2026 Season 2 on at
    Hi,
     
    Use int642Str instead of int2Str
     
    Also when u debug after selecting the buffer, can u see a value?

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
    Hi,
     
    this is normal, since the “LogisticsPostalAddress” table contains validform and validto fields that prevent the selection of records  
    so you need to add validtimestate to the query.
    Validfrom fromDate = 05\19\2023;
    ValidTo toDate = 09\09\2024;
    
    Select validtimestate(fromDate,toDate) * from LogisticsPostalAddress 
    where LogisticsPostalAddress.RecId == 5642043649;
    Best regards,
    Mohamed Amine MAHMOUDI
  • SA-20091232-0 Profile Picture
    89 on at
     
    I tried and I'm getting error in your suggested way of fetching data, 
    error is as follows:

    1.
     
     
    2.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    26,826 Super User 2026 Season 1 on at
    Hi,
     
    Try this :
            LogisticsPostalAddress logisticsPostalAddress;
            TransDate        fromDate, toDate;
            fromDate = str2Date("05/19/2023", 123);
            toDate = str2Date("09/09/2024", 123);
    
            Select validtimestate(fromDate,toDate) * from logisticsPostalAddress
            where logisticsPostalAddress.RecId == 5642043649;
    Best regards,
    Mohamed Amine MAHMOUDI
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    3,634 Moderator on at
    When you say you are working with a runnable class, are you sure company parameter is added at the project level? Or do you have any parameter which mentions the current company?
     
    And from your screenshot of table browser, I can see that the address got expired on 9th of september. In that case, this is obvious that FO doesn't show the record. You need to use valid time state key to get the right buffer.
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad
  • Raj Borad Profile Picture
    1,590 on at
    Hi,
     
    Are you running the class in the same company which you set in the property of the project?
     
  • Waed Ayyad Profile Picture
    9,222 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 539 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 366 Super User 2026 Season 2

#3
CU-1234529-002 Profile Picture

CU-1234529-002 197

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans