function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srikanth julakantisrikanth julakanti 

generate random number using vf and controller

i want 2 knw how to generate random number using vf and controller plz can anyone suggest me syntax r ping some code advance thanks 2 all
Best Answer chosen by srikanth julakanti

All Answers

RamuRamu (Salesforce Developers) 
This post might help

https://success.salesforce.com/answers#!/feedtype=SINGLE_QUESTION_DETAIL&id=90630000000ghFcAAI
praveen murugesanpraveen murugesan
This was selected as the best answer
Virendra ChouhanVirendra Chouhan
Hi Srikanth

There is a couple of ways to generate random number . you want to use Vf and Controller so here is Apex code so you can create a class with this code and call it in controller.
http://www.cloudsuccess.com/blog/generating-random-numbers-in-apex-force-com/

https://developer.salesforce.com/blogs/developer-relations/2013/07/selecting-random-numbers-and-records-on-the-force-com-platform-part-1.html

using a formula field to generate random numbers in Salesforce
http://sfdcinsea.wordpress.com/2014/03/24/using-a-formula-field-to-generate-random-numbers-in-salesforce/