How to fetch random record from catalog table?

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 2
Joined: May 9, 2018
Company: GOLDENNET BİLGİ TEKNOLOJİLERİ

How to fetch random record from catalog table?
In MsSql, I can do this with a query. How can I do it in 1C?
Example: There are 500 records in the catalog table. I want to list 15 of them randomly. How can I do that?

 
#2
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Try to access your query results through Get(Index) method in which instead of Index use generated random number in the range from 0 to number of records in the query results.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.