12.07.2015 Views

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

Database.com Metadata API Developer's Guide - Salesforce.com

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Metadata</strong> TypesPicklist (Including Dependent Picklist)Field NameprobabilityreverseRolereviewedwonField TypeintstringbooleanbooleanDescriptionIndicates whether this value is a probability percentage (true), ornot (false). This field is only relevant for the standard Stagefield in opportunities. For more information about opportunities,see “Opportunities Overview” in the <strong>Database</strong>.<strong>com</strong> online help.This field is available in <strong>API</strong> version 16.0 and later.A picklist value corresponding to a reverse role name for a partner.If the role is “subcontractor”, then the reverse role might be “generalcontractor”. Assigning a partner role to an account in <strong>Database</strong>.<strong>com</strong>creates a reverse partner relationship so that both accounts list theother as a partner. This field is only relevant for partner roles.For more information, see “Partner Fields” in the <strong>Database</strong>.<strong>com</strong>online help.This field is available in <strong>API</strong> version 18.0 and later.Indicates whether this value is associated with a reviewed status(true), or not (false). This field is only relevant for the standardStatus field in solutions. For more information aboutopportunities, see “Creating Solutions” in the <strong>Database</strong>.<strong>com</strong> onlinehelp. This field is available in <strong>API</strong> version 16.0 and later.Indicates whether this value is associated with a closed or won status(true), or not (false). This field is only relevant for the standardStage field in opportunities. This field is available in <strong>API</strong> version16.0 and later.Java SampleThe following sample uses a picklist. For a <strong>com</strong>plete sample of using a picklist with record types and profiles, see Profile onpage 130.public void setPicklistValues() {// Create a picklistPicklist 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);try {AsyncResult[] ars =metadataConnection.create(new <strong>Metadata</strong>[] {expenseStatusField});} catch (ConnectionException ce) {ce.printStackTrace();}99

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!