高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
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
public with sharing class AccountQualifyAlertController {
    
    public String idl { get; set;}
    public boolean is_Alert_Qualify {get; set;}
 
    public AccountQualifyAlertController() {
        idl = ApexPages.currentPage().getParameters().get('id');
    }
 
    public AccountQualifyAlertController(ApexPages.StandardController controller) {
        idl = ApexPages.currentPage().getParameters().get('id');
    }
 
    public void init() {
        list<Account> accList = [select id, 
                                        Quolified_Approve_Status__c, 
                                        If_Need_Quolified__c 
                                   from Account 
                                  where id =:idl];
        is_Alert_Qualify = false;
        
        if (accList != null && accList.size() > 0) {
            //空指针报错修改 thh 20220411 start
            if ('Draft'.equals(accList[0].Quolified_Approve_Status__c)
            && accList[0].If_Need_Quolified__c == true) {
                is_Alert_Qualify = true;
            }
            //空指针报错修改 thh 20220411 end
        }
    }
}