Skip to main content

Notifications

Dynamics 365 Community / Forums / Finance forum / LogisticsPostalAddress...
Finance forum
Suggested answer

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

Posted on by 18
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.
 
 
  • Raj Borad Profile Picture
    Raj Borad 367 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    Hi,
     
    Are you running the class in the same company which you set in the property of the project?
     
  • Waed Ayyad Profile Picture
    Waed Ayyad 5,305 Super User 2024 Season 2 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    Hi,

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

    Thanks
    Waed Ayyad
  • Suggested answer
    Bharani Preetham Peraka Profile Picture
    Bharani Preetham Pe... 3,548 Moderator on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    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.
  • Suggested answer
    Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,275 Super User 2024 Season 2 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    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
  • SA-20091232-0 Profile Picture
    SA-20091232-0 18 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
     
    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
    Mohamed Amine Mahmoudi 9,275 Super User 2024 Season 2 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    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
  • Layan Jwei Profile Picture
    Layan Jwei 6,964 Super User 2024 Season 2 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    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
  • Mohamed Amine Mahmoudi Profile Picture
    Mohamed Amine Mahmoudi 9,275 Super User 2024 Season 2 on at
    LogisticsPostalAddress table is not returning any data even it exists in DB
    Moved from MS Dynamics AX Form

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,435 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,317 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans