-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCTRL_OpportunityStage.cls
37 lines (28 loc) · 1.02 KB
/
CTRL_OpportunityStage.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public with sharing class CTRL_OpportunityStage
{
private final Opportunity opportunityRecord;
public String oppStageList {get;set;}
public String oppStageNum {get;set;}
public CTRL_OpportunityStage(ApexPages.StandardController stdController)
{
this.opportunityRecord = (Opportunity)stdController.getRecord();
oppStageList = '[\'';
oppStageNum = '[\'';
getPicklistValues();
}
public void getPicklistValues()
{
Set<String> stages = new Set<String>(UTIL_PickList.describe(opportunityRecord.Id, DAL_Opportunity.FIELD_STAGENAME));
Integer i = 1;
for (String stage : stages)
{
oppStageList += stage + '\', \'';
oppStageNum += i + '\', \'';
i += 1;
}
oppStageList = oppStageList.substring(0, oppStageList.length() - 3);
oppStageList = oppStageList + ']';
oppStageNum = oppStageNum.substring(0, oppStageNum.length() - 3);
oppStageNum = oppStageNum + ']';
}
}