fork download
  1. public class ServiceContractController {
  2. @AuraEnabled(cacheable=true)
  3. public static List<SVMXC__Service_Contract__c> getSortedContracts(Id opportunityId, String sortField, Boolean isAscending) {
  4. // Query related Service/Maintenance Contracts with Opportunity relationship
  5. String sortOrder = isAscending ? 'ASC' : 'DESC';
  6.  
  7. // Query based on Opportunity lookup field (assuming it exists on the Service/Maintenance Contract object)
  8. return [SELECT Id, Name, SVMXC__Start_Date__c, SVMXC__End_Date__c FROM SVMXC__Service_Contract__c WHERE Related_Opportunity_SVMX_PS__c = :opportunityId ORDER BY :sortField :isAscending];
  9. }
  10. }
Success #stdin #stdout #stderr 0.01s 9024KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #ServiceContractController
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #ServiceContractController (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:2: parse error, expected '}'