You need to sign in to do that
Don't have an account?
Patricia Lim
Display name instead of ID when inserting records from VF page
I have a custom controller behind a VF page that sets the value of one of the fields to be the one that the user inputs in another field:
However when the record is saved to my org, the ID is saved in the `recipient__c` name field instead of the name that was inputted by the user. How can I get the name to save and display instead of the ID?
public void saveScholarship(){ rec = new recipient__c(School__c=sch.School__c); insert rec; sch.Recipient__c = rec.Id; insert sch; sch = new scholarship_award__c(recipient__c=rec.Id); } }
However when the record is saved to my org, the ID is saved in the `recipient__c` name field instead of the name that was inputted by the user. How can I get the name to save and display instead of the ID?
Greetings!
If you have field name called "Name" on the Object Recipient__c then you can simply display the name as below:
rec.Name(if it is standard field) or else rec.Name__c;
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Attemped using a SOQL query to lookup the recipient record: