global with sharing class SelectRentalButtonController { @AuraEnabled public static Equipment_Set_Detail__c getEquipmentSetId(String recordId){ Equipment_Set_Detail__c res=new Equipment_Set_Detail__c(); try{ res=[select Equipment_Set__c,Select_rental__c from Equipment_Set_Detail__c where Id=: recordId]; } catch(Exception e){ System.debug(Logginglevel.info,'*******e'+e); } return res; } @AuraEnabled public static List getEquipmentSet(String esid){ try{ List res=[select Id,Name,Select_rental__c from Equipment_Set_Detail__c where Equipment_Set__c = : esid]; return res; } catch(Exception e){ System.debug(Logginglevel.info,'*******e'+e); } return null; } @AuraEnabled public static List updateEquipment(List sqlResult){ List res=new List(); try{ for(Equipment_Set_Detail__c equipMent : sqlResult){ update equipMent; res.add('success'); } } catch(Exception e){ System.debug(Logginglevel.info,'*******e'+e); } return res; } @AuraEnabled public static List findIdArea(List id){ List res = new List(); try{ res=[select Id,Select_rental__c from Equipment_Set_Detail__c where Id IN : id ]; } catch (Exception e) { System.debug(Logginglevel.info,'*******e'+e); } return res; } @AuraEnabled public static String getSessionId(){ return UserInfo.getSessionId(); } @AuraEnabled public static List getRecords(){ List res= new List(); try{ List obj = [select Id from Equipment_Set_Detail__c where Select_rental__c=true]; for(Equipment_Set_Detail__c equipMent : obj){ res.add(equipMent.Id); } } catch(Exception e){ System.debug(Logginglevel.info,'*******e'+e); } return res; } }