You need to sign in to do that
Don't have an account?
Gonzalosr
set an existing picklist type from a visual force page.
Hi,
i have a object called Details that have a picklist called Item_list, i know how to add an remove posible values of the list from the config of the object, but i want to do a visualforce page where i can add or remove values, and all Details objects ( old objects, new objects ) will have this values to be selected.
Thanks
i have a object called Details that have a picklist called Item_list, i know how to add an remove posible values of the list from the config of the object, but i want to do a visualforce page where i can add or remove values, and all Details objects ( old objects, new objects ) will have this values to be selected.
Thanks
I guess, you can use meta data api to do that. Please refer to the docs.
Here is a sample lifted from the Meta Data API doc:
// Create a picklist Picklist expenseStatus = new Picklist(); PicklistValue unsubmitted = new PicklistValue(); unsubmitted.setFullName("Unsubmitted"); PicklistValue submitted = new PicklistValue(); submitted.setFullName("Submitted"); PicklistValue approved = new PicklistValue(); approved.setFullName("Approved"); PicklistValue rejected = new PicklistValue(); rejected.setFullName("Rejected"); expenseStatus.setPicklistValues(new PicklistValue[] {unsubmitted, submitted, approved, rejected}); CustomField expenseStatusField = new CustomField(); expenseStatusField.setFullName("ExpenseReport__c.ExpenseStatus__c"); expenseStatusField.setLabel("Expense Report Status"); expenseStatusField.setType(FieldType.Picklist); expenseStatusField.setPicklist(expenseStatus);
create(expenseStatusField);
thanks for your reply, my problem is that i want to create or set the picklist from a visualforce page. this example is to set a picklist from Java.