+ Start a Discussion
MJRDeveloperMJRDeveloper 

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?

FromCRMWonderlandFromCRMWonderland
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
MJRDeveloperMJRDeveloper

Wonderland,

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
                         id,
                         RecordType.businessprocessid
                         from Lead 
                         limit 1];
      
      BusinessProcess BP = [select 
                               Id, 
                               name, 
                               TableEnumOrId, 
                               NamespacePrefix 
                               from businessprocess 
                               where id = :MyLead.RecordType.businessprocessid]; 

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

 

 

 

nishwalnishwal

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?

e.lestradee.lestrade

I've submitted an idea about this point: https://sites.secure.force.com/success/ideaView?id=08730000000bhbwAAA

 

Vote for it!