You need to sign in to do that
Don't have an account?
micwa
Picklist: Assign in Apex
Hi
I need to convert a contact back to a lead. The contact object has a picklist "Gender__c" and the leadobject has a picklist "Gender__c" too. When I try to create a new leadobject and asign the gender to it I get an "System.StringException: Invalid id: male" error.
How do I have to assign that?
I need to convert a contact back to a lead. The contact object has a picklist "Gender__c" and the leadobject has a picklist "Gender__c" too. When I try to create a new leadobject and asign the gender to it I get an "System.StringException: Invalid id: male" error.
Code:
Contact contact = [Select c.Gender__c from Contact c where c.Id = ... limit 1]; Lead createdLead = new Lead(Gender__c = contact.Gender__c);
How do I have to assign that?
The Exception was caused by something else.