daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Create the valueSet for picklist type
  2. MetadataService.ValueSet picklistValueSet = new MetadataService.ValueSet();
  3.  
  4. //For each ValueSet, we have either ValueSetValuesDefinition or ValueSettings and some other attributes
  5. MetadataService.ValueSetValuesDefinition valueDefinition = new MetadataService.ValueSetValuesDefinition();
  6.  
  7. List<MetadataService.CustomValue> values = new List<MetadataService.CustomValue>();
  8. MetadataService.CustomValue customValue1 = new MetadataService.CustomValue();
  9.     //Adding "Default" value as one picklist value in the newly created picklist
  10.   customValue1.fullName = valFullName ;
  11.   customValue1.description = '';
  12.   customValue1.isActive =TRUE;
  13.   customValue1.default_x = FALSE;
  14.   customValue1.label = valLabel;
  15.   values.add(customValue1);
  16.  
  17. //It will be list of CustomValue
  18. valueDefinition.value = values;
  19. valueDefinition.sorted = false;
  20.  
  21. //set the valueSetDefinition
  22. picklistValueSet.valueSetDefinition = valueDefinition;
  23.  
  24. //Set the valueSet for picklist type
  25. customField.valueSet = picklistValueSet;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top