You need to sign in to do that
Don't have an account?

How to create a custom picklist field from another picklist using apex class?
Hi,
I was wondering if there is a way to take a picklist and it's values from one object and using apex class, we create another picklist and the same values on another object.
Essentially, i want to take the Campaign Type field (format: picklist) and its various values and create a picklist field on customObj1__c that has the same picklist values. How would this be possible? I am having trouble trying to figure out how I can use apex class to do this.
Another scenario that would be okay, if we assume that the customObj1__c already has a picklist field fieldPick__c and certain values. Is there a way to take the Campaign type picklist values and save them as the fieldPick__c values on the customObj1__c object?
I was wondering if there is a way to take a picklist and it's values from one object and using apex class, we create another picklist and the same values on another object.
Essentially, i want to take the Campaign Type field (format: picklist) and its various values and create a picklist field on customObj1__c that has the same picklist values. How would this be possible? I am having trouble trying to figure out how I can use apex class to do this.
Another scenario that would be okay, if we assume that the customObj1__c already has a picklist field fieldPick__c and certain values. Is there a way to take the Campaign type picklist values and save them as the fieldPick__c values on the customObj1__c object?
Keep in mind that if you are using RecordTypes, then you would still need to manually assign the values to each RecordType.
This does not use an Apex class, but I believe this is more along the lines of what you are looking to accomplish. An Apex class cannot be used to update metadata.
All Answers
Keep in mind that if you are using RecordTypes, then you would still need to manually assign the values to each RecordType.
This does not use an Apex class, but I believe this is more along the lines of what you are looking to accomplish. An Apex class cannot be used to update metadata.
Thanks for you responses. It seems this has to be done manually as suggested or through API.