function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Using BusinessProcess to determine picklist values for LeadStatus

The Web Services API Developers Guide says the following...


Use the BusinessProcess object to offer different subsets of picklist values to different users for the LeadStatus, CaseStatus, and OpportunityStage fields. Similar to a RecordType, a BusinessProcess identifies the type of a row in a Case, Lead, or Opportunity and implies a subset of picklist values for these three fields. The values for the remaining picklist fields are driven off of RecordType.


What it doesn't give is an EXAMPLE of HOW we can use the BusinessProcess object to determine the subset of picklist values. Can I get some guidence on this one?

If you go to setup - customize.... u will find, Lead Process for Lead, Sales Process for Oppty, Support Process for Case. For Lead,Oppty, Case; for creating record type, u need to have corresponding processes in place first. You can which values to be avialble for the recordtype for any picklist field except LeadStatus, CaseStatus and OpportunityStage. Because for "LeadStatus, CaseStatus and OpportunityStage", vlaues of picklist to available are defined by corresponding processes. ---- alok


I understand how to set up and use processes via the UI. I am trying to use the API to determine the Converted LeadStatus options based on Lead Process or Record Type. Any assitance with code example. Let me give you an example of what I am trying to do. In the code below, I can get ALL leadstatus where converted = true, but I can NOT get the ONE leadstatus where converted = true AND the businessprocessid is the business process defined for MyLead. Thanks to anyone who can help!



public list<selectOption> getconvertedstatuslist(){  
      list<selectoption> returnlist = new list<selectoption>();

      Lead MyLead = [Select
                         from Lead 
                         limit 1];
      BusinessProcess BP = [select 
                               from businessprocess 
                               where id = :MyLead.RecordType.businessprocessid]; 

      list<LeadStatus> statuses = [select 
                                     from LeadStatus 
                                     where IsConverted=true];   
      for(LeadStatus LS:statuses){
         returnlist.add(new selectoption(, LS.MasterLabel));
      returnlist.add(new selectoption(,;
      return returnlist;





i m also stuck with the same thing. I have to get the Lead Status picklist values that are available to a particular business process in conversion state.


Any idea plz?


I've submitted an idea about this point:


Vote for it!