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
Glenn Soden 9Glenn Soden 9 

How to use another objects entries as a picklist

Trying to use entries from one objec to another but stuck.  I have one object "Project" and another object "Equipment".  Equipment is a container for various items, details, type model# etc.  Like a catalog.    On the project I would like to use these entries as a "picklist" on object and pull some of the fields over from the peice of equipment that has been selected.  What would be the best way to acheive this?  Would process builder work or other?  Not a coder so trying to find solution without code. But if requires code may have to go that route somehow.  Thanks in advance
Best Answer chosen by Glenn Soden 9
LBKLBK
SELECT Id, Name, Start_Date__c, End_Date__c, Equipment__r.Id, Equipment__r.Name, Equipment__r.Type__c FROM Project__c WHERE Name = 'MyProject'
This above query fetches the Project and the related Equipment. You can use them in your APEX classes as well as Visualforce pages.
 

All Answers

LBKLBK
You need Lookup relationship not Picklist to use the values from another Object.
Picklist can be defined globally and used across multiple fields, but not from another object.

Please create a Lookup Relatioship type field in "Project" object and refer Equipment object in it.
Glenn Soden 9Glenn Soden 9
Ok that worked well but in addition to just bringing in the "item" title I also need to bring in some of its fields to populate on page as well.  Am I missing something?  Thanks LBK
LBKLBK
You can utilize the relationship to bring any available fields.

Object 1: Project__c (Id, Name, Start_Date__c, End_Date__c, Equipement__c)

Object 2 : Equipment__c (Id, Name, Type__c)

You can use Equipment__r.Id, Equipment__r.Name, Equipment__r.Type__c to fetch Equipment details in Project__c.

Hope this helps.
LBKLBK
SELECT Id, Name, Start_Date__c, End_Date__c, Equipment__r.Id, Equipment__r.Name, Equipment__r.Type__c FROM Project__c WHERE Name = 'MyProject'
This above query fetches the Project and the related Equipment. You can use them in your APEX classes as well as Visualforce pages.
 
This was selected as the best answer
Glenn Soden 9Glenn Soden 9
thank you LBK