Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

How to find unique record in a table in business central

Posted on by 153
Hi Guys,
In my below table, if i have multiple same record then I want to find unique value of date. or otherwise get count of unique record.
How to get/find that unique date through AL code. 
Output: 7/7/2023
               7/8/2023
 
 
 
Is any way to do this.
 
 
 
Categories:
  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 on at
    How to find unique record in a table in business central
    To do this, you can start by filtering the records based on your date.. once you have filtered the records, you can compare them to another set of records and find the ones that do not match..
                if YourTableBuffer.FindSet() then
                repeat begin
                    YourTableBufferTwo.SetFilter(Date,'<>%1', YourTableBuffer.Date);
                    if (YourTableBufferTwo.FindSet())
                    then begin
                        ListOfUnMatchedRecords.Add(YourTableBufferTwo.ID);
                        count := count+1
                    end;
                    until YourTableBufferTwo.Next() = 0;
                end;
                until YourTableBuffer.Next() = 0;
    This is the example code for you.. 
    Regards
  • Nilam Bhor Profile Picture
    Nilam Bhor 153 on at
    How to find unique record in a table in business central
    Hi SeGra ,
    I already follow this blog. In this blog it will show the text data type count.
    & I want to find unique date.
    Is any other way to do this.
  • Suggested answer
    SeGra Profile Picture
    SeGra 44 on at
    How to find unique record in a table in business central
    Hi,
    please refer to this blog Post https://yzhums.com/34036/
     
     

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans