You need to sign in to do that
Don't have an account?
Parth Srivastava
please help me with test class
public class ProcessStepListController {
@AuraEnabled
public static List<Process_Step__c> getSteps(String crntOppId) {
String crntOppStage;
for(Opportunity opp : [Select StageName
From Opportunity
Where Id =: crntOppId]){
crntOppStage = opp.StageName;
}
list<Process_Step__c> stepsList = [SELECT Id, Name, Process_Step_Name__c, Stage__c, Date__c, Complete__c, Note__c
FROM Process_Step__c
Where Opportunity__c =: crntOppId
AND Stage__c =: crntOppStage
order by createdDate asc];
return stepsList;
}
@AuraEnabled
public static void updateSteps (list<Process_Step__c> stepsList){
try{
for(Process_Step__c step : stepsList){
if(step.Complete__c){
step.Date__c = date.today();
}
else{
step.Date__c = null;
}
}
Database.update(stepsList);
}catch(exception ex){
system.debug('An error occurred---:' + ex);
}
}
}
@AuraEnabled
public static List<Process_Step__c> getSteps(String crntOppId) {
String crntOppStage;
for(Opportunity opp : [Select StageName
From Opportunity
Where Id =: crntOppId]){
crntOppStage = opp.StageName;
}
list<Process_Step__c> stepsList = [SELECT Id, Name, Process_Step_Name__c, Stage__c, Date__c, Complete__c, Note__c
FROM Process_Step__c
Where Opportunity__c =: crntOppId
AND Stage__c =: crntOppStage
order by createdDate asc];
return stepsList;
}
@AuraEnabled
public static void updateSteps (list<Process_Step__c> stepsList){
try{
for(Process_Step__c step : stepsList){
if(step.Complete__c){
step.Date__c = date.today();
}
else{
step.Date__c = null;
}
}
Database.update(stepsList);
}catch(exception ex){
system.debug('An error occurred---:' + ex);
}
}
}
Raj Vakati
Use this code