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
Luffy Carl_opLuffy Carl_op 

How to create a record with a loop-up field from visualforce page?

There is a page to add new record of the worktime__c object,which having a loop-up field to user,named Worker__c. I create a selectList to show worktime__c.Worker__r.Name, and others info. But i save this record by the method in apex class. It will just save others info, not the Worker__c. How can I save those info at one time?
Rajiv Bhatt 16Rajiv Bhatt 16
can you share the apex code? you will need to fetch the user id from the user object using the name of the worker and then set that id on the worker__c field