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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans