2

I can retrieve Opportunity field metadata, including picklist values, with the REST API like so:

[{"active"=>true, "defaultValue"=>false, "label"=>"Prospecting", "validFor"=>nil, "value"=>"Prospecting"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Qualification", "validFor"=>nil, "value"=>"Qualification"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Needs Analysis", "validFor"=>nil, "value"=>"Needs Analysis"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Value Proposition", "validFor"=>nil, "value"=>"Value Proposition"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Id. Decision Makers", "validFor"=>nil, "value"=>"Id. Decision Makers"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Perception Analysis", "validFor"=>nil, "value"=>"Perception Analysis"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Proposal/Price Quote", "validFor"=>nil, "value"=>"Proposal/Price Quote"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Negotiation/Review", "validFor"=>nil, "value"=>"Negotiation/Review"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Closed Won", "validFor"=>nil, "value"=>"Closed Won"},
 {"active"=>true, "defaultValue"=>false, "label"=>"Closed Lost", "validFor"=>nil, "value"=>"Closed Lost"}]

But I can't seem to find a way to retrieve the "Type" metadata associated with each picklist value that you can see with the web interface:

screenshot

Is there any way to get that "Type" metadata using the REST API?

2

This is actually data, not metadata, and you can query for it in the OpportunityStage object.

SELECT IsActive, IsClosed, IsWon FROM OpportunityStage

The Type field itself is not stored, but can be inferred from the IsClosed and IsWon fields. If IsClosed is false, the Type is Open. If IsClosed is true and IsWon is false, the Type is Closed/Lost. If IsClosed is true and IsWon is true, the Type is Closed/Won.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.