You need to sign in to do that
Don't have an account?
Assh
Assigning contact name
Hi All,
I have a custom object of text type.This custom object has a lookup relationship with "contact" standard object. I want to assign contact name to the custom object name in the Apex class.
When I save the custom object[customer object] after I enter other required fields, then the record is saving with random name like "a0650000007xpaD". How can I assign contact name to the customer object name? Could anyone please help me with this? Your help is greatly appreciated.
I have written following statement in the code:
customer.name = customer.Contact__c;
controller.save();
Assuming Contact__c is a lookup relationship, this is expected as you are copying the ID of the contact into the customer.name field.
To copy the contact name you would need:
All Answers
Assuming Contact__c is a lookup relationship, this is expected as you are copying the ID of the contact into the customer.name field.
To copy the contact name you would need:
Hi,
Thak you for your suggestion, and I implemented as you mentioned. It is working fine.