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
Matthew Hayes 46Matthew Hayes 46 

Random name generator

How would I create a field in Salesforce, communities, that would randomly pick a name from a object that housed a list of say 10000 names?  What the goal is when one of our users is in our system they could randomly pick a name from a list in Salesforce.  Is that possible?  How would I go about setting something like this up?  I am not a developer.
Best Answer chosen by Matthew Hayes 46
Alain CabonAlain Cabon
@Matthew Hayes 

The easiest way is to create a relationship (lookup) with the object that houses the list of 10000 names.
This field will be a lookup field by default showing the field Name and if the user enters some characters, the search is activated immediatly and pick the first found names (always ordered nevertheless).

For a "fake" random order, you can add a number front of the name without order for the name themselves ( 1-Spencer Tracy, 500-Arnold Sharwzy; 2871-John Rambo ). and if the user enters any numbers between 1 and 10000, the corresponding name begining with the number will appear but you need other fields, Name__c or FirstName__c and LastName__c selected by a formula after the action of save.

All Answers

Alain CabonAlain Cabon
@Matthew Hayes 

The easiest way is to create a relationship (lookup) with the object that houses the list of 10000 names.
This field will be a lookup field by default showing the field Name and if the user enters some characters, the search is activated immediatly and pick the first found names (always ordered nevertheless).

For a "fake" random order, you can add a number front of the name without order for the name themselves ( 1-Spencer Tracy, 500-Arnold Sharwzy; 2871-John Rambo ). and if the user enters any numbers between 1 and 10000, the corresponding name begining with the number will appear but you need other fields, Name__c or FirstName__c and LastName__c selected by a formula after the action of save.
This was selected as the best answer
Alex FinchAlex Finch
Custom objects can participate in relationship queries. Salesforce ensures that your custom object names, custom field names, and the relationship names that are associated with them remain unique, even if a standard object with the same name is available now or in the future. Having unique relationship queries is important in cases where the query traverses relationships that use the object and, field, and relationship names. If  you want to genrate random names you can use Random Name Generator (https://www.colorschemer.com/fake-name-generator/).