|
|
暴躁的石榴 · 翻译 - Dolibarr ERP CRM ...· 2 月前 · |
|
|
不羁的饺子 · Debezium | Apache Flink· 2 月前 · |
|
|
讲道义的烈酒 · Debezium-JSON--流式计算 ...· 2 月前 · |
|
|
从容的大脸猫 · 零代码第三方数据接入 | TDengine ...· 2 月前 · |
|
|
迷茫的马克杯 · 从VBA中的范围中删除特殊字符开发者社区· 2 月前 · |
|
|
被表白的绿茶 · Kratos微服务框架下的认证和鉴权-阿里云 ...· 2 年前 · |
|
|
没有腹肌的蚂蚁 · JavaScript do/while ...· 3 年前 · |
|
|
飘逸的蘑菇 · (十三)SparkSQL ...· 3 年前 · |
Try the below changes:
public with sharing class bikeSearchResultController { @AuraEnabled(cacheable=true) public static list<Car__c> cardetailsapexmethod(string cartypeid){ try { list<Car__c> carList = new list<Car__c>(); if(String.isEmpty(cartypeid)){ carList = [SELECT Id,Available_For_Rent__c,Build_Year__c,Car_Type__c,Name,Picture__c FROM Car__c]; else if(!String.isEmpty(cartypeid)){ carList = [SELECT Id,Available_For_Rent__c,Build_Year__c,Car_Type__c,Name,Picture__c FROM Car__c WHERE Car_Type__c=:cartypeid]; return carList; } catch (Exception e) { throw new AuraHandledException(e.getMessage());
Thanks,
Maharajan.C
All Answers
Can you try if you are able to return after assigning the response of the soql to a list variable and returning the list variable like changing the above code to below:
list<car__c> clist= [SELECT Id,Available_For_Rent__c,Build_Year__c,Car_Type__c,Name,Picture__c FROM Car__c]; return clist;
Looking forward to your response.
Thanks.
Try the below changes:
public with sharing class bikeSearchResultController { @AuraEnabled(cacheable=true) public static list<Car__c> cardetailsapexmethod(string cartypeid){ try { list<Car__c> carList = new list<Car__c>(); if(String.isEmpty(cartypeid)){ carList = [SELECT Id,Available_For_Rent__c,Build_Year__c,Car_Type__c,Name,Picture__c FROM Car__c]; else if(!String.isEmpty(cartypeid)){ carList = [SELECT Id,Available_For_Rent__c,Build_Year__c,Car_Type__c,Name,Picture__c FROM Car__c WHERE Car_Type__c=:cartypeid]; return carList; } catch (Exception e) { throw new AuraHandledException(e.getMessage());
Thanks,
Maharajan.C