Activity Forums Salesforce® Discussions How to show child query count in lightning component in Salesforce?

  • Piyush

    Member
    November 12, 2019 at 5:41 am

    Hi,

    You can try below code to show child query count in lightning component in salesforce:-

    List<Account> lstAccount = [ Select id,name,(SELECT id,Name From abc__Site__r ) from Account ];
    	For ( Account acc : lstAccount )
    	{
    	     List<SVMXC__Site__c> lstSite = acc.abc__Site__r;
    	     if( lstSite.size() > 1 )
    	     {
    	        System.debug('More then one site');
    	     }
    	}

    For more:-https://developer.salesforce.com/forums/?id=906F0000000DBc6IAG

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos