i have created a table with fields id,name,roll no,age
id name rollno age
1 A 1 20
2 b 2 20
3 c 1 20
i will create a actiuon called unique
now i have to count unique records in roll no field
like it should show message after clicking on action unique then it should show
"No of unique records is 2"
0
Answers
This code creates a "Dictionary" (an object from .NET framework which is a collection of keys and values), then iterates over your table's records. For each record, it checks if its "rollno" is already in the "Dictionary". If it's not, it's added. After going through all records, the count of keys in the "Dictionary" is the count of unique "rollno's".
After this action is run, it will display a message stating the number of unique roll numbers in the table.
Remember, this process only checks for uniqueness in the "rollno" field when you run the action. If you want to enforce uniqueness at the time of data entry, you would need a different approach (like adding code to the "OnValidate" trigger for the "rollno" field).