You need to sign in to do that
Don't have an account?
Indianajones
Help please with soql and search
Hey, i create lightning-accordion with account name. in my tabs i have opportunity with amount. I have search with Account name. I need search with Account name and Amount of Opportunity. I have Soql for Account Name:
How its look:
screen 2.
thanks.
public class OpportunityController { @AuraEnabled(cacheable=true) public static List<Account> getAcc( String searchKey) { string searchKeyword = '%' + searchKey + '%'; list<Account> accountListRecord = new list<Account>(); for(Account accObj : [SELECT Id, Name,(select id,Name,Amount,CreatedDate,CloseDate, AccountId from opportunities where StageName = 'Closed Won') FROM Account WHERE name LIKE : searchKeyword]){ accountListRecord.add(accObj); } if(accountListRecord.size() == 0){ throw new AuraHandledException('No Record Found..'); } return accountListRecord; } }How i can update my code for search account name + opportunity amount?
How its look:
screen 2.
thanks.
Do you want to search the opportunity based on the amount from any specific Account(only from 1 account) or in general?
Thanks!
There should be a search for the total closed Amount of all Accounts
Thanks!