-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertyToHoldParentViewURL
More file actions
39 lines (38 loc) · 1.75 KB
/
PropertyToHoldParentViewURL
File metadata and controls
39 lines (38 loc) · 1.75 KB
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
38
39
//property to hold parent view url to solve cross domain issue
redirectUrl = controller.view().getUrl();
acct = (Account)controller.getRecord();
if(acct != null && !String.isBlank(acct.Id)) {
allLeadQualList = new List<Lead_Qualification__c>();
leadQualificationObj = new Lead_Qualification__c();
allLeadQualList = [select Id, Discovery_Notes__c from Lead_Qualification__c where Opportunity__c = : acct.ID
ORDER BY LastModifiedDate DESC LIMIT 1];
if(allLeadQualList.size() >0){
leadQualificationObj = allLeadQualList.get(0);
viewMode = 'read';
}else{
viewMode = 'edit';
}
}
else{
viewMode = 'edit';
}
}
//property to hold parent view url to solve cross domain issue
redirectUrl = controller.view().getUrl();
networkInformationObj = (Network_Information__c)controller.getRecord();
if(Network_Information__c != null && !String.isBlank(networkInformationObj.Id)) {
allnetworkInformationList = new List<Network_Information__c>();
networkInformationObj = new Network_Information__c();
allnetworkInformationList = [select Id, Network_Information__c from Network_Information__c where Network_Information__c = : networkInformationObj.ID
ORDER BY LastModifiedDate DESC LIMIT 1];
if(allnetworkInformationList.size() >0){
networkInformationObj = allnetworkInformationList.get(0);
viewMode = 'read';
}else{
viewMode = 'edit';
}
}
else{
viewMode = 'edit';
}
}