Skip to content

Instantly share code, notes, and snippets.

@miragedeb
Last active August 29, 2015 14:17
Show Gist options
  • Save miragedeb/25f3054a7cc304f03ac8 to your computer and use it in GitHub Desktop.
Save miragedeb/25f3054a7cc304f03ac8 to your computer and use it in GitHub Desktop.
DuplicateQARelController
public with sharing class DuplicateQARelController{
//Declare the variables to be used
public List<QA_Release__c> releases {get;set;}
private Id releaseClientId;
private final QA_Release__c qa;
//Put all code inside constructor since it will be initialized when page is rendered
public DuplicateQARelController(ApexPages.StandardController stdController) {
//Extract the Id of the current QA Release record
Id qaId = stdController.getId();
//Extract the client Id from the above record
QA_Release__c qaRel = [SELECT Client__c FROM QA_Release__c
WHERE Id= :qaId ];
releaseClientId = qaRel.Client__c;
System.debug('Id is : ' + releaseClientId);
//Find all QA Release records with above Client
releases = [SELECT Name, Owner.Name, Objective__c, Due_Date__c FROM QA_Release__c
WHERE (Client__c= :releaseClientId AND (Status__c='Not Started' OR Status__c = 'In Progress' OR
Status__c = 'On Hold' OR Status__c ='Re-opened')) ];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment