@AuraEnabled
public static void PerSFTVersion(Id artId) {
List<Quote> lstQuoToUpdate = new List<Quote>();
for(Quote Qu : [select id,Version__c from Quote where id =: artId]){
decimal count = Qu.Version__c;
If((count == Null)){
Qu.Version__c = 1;
lstQuoToUpdate.add(Qu);
}
If((count != Null)){
count++;
system.debug('count++'+ count);
Qu.Version__c = count;
lstQuoToUpdate.add(Qu);
}
}
if(lstQuoToUpdate.size() > 0){
update lstQuoToUpdate;
}
}
5 risposte
Hi
This is same writting test class for any other static method .
For your test class
Create method and create data for Quote object .
insert that data and get id of inserted record.
and call Auramethod as follow .
Lets say your class name is MyAura in which you have written aura method.
then call that method like
MyAura.PerSFTVersion(artId);
Please let me know if its works.