Hello,
I have below code which get number of records with related owner name. Its working without any issue. But I need owner name not to be repeat and count related number of records in leads and opportunities.
My expected output:
Owner Name No.of Leads No.of Opportunities
ABC 2 5
BAC 4 6
My code.
static void countalluser(Args _args) { smmLeadTable leadTable; smmOpportunityTable ssmmOpportunityTable; while select count(OpportunityId) from ssmmOpportunityTable group by ssmmOpportunityTable.OwnerWorker { Info(strFmt("Number of Records opportu %1 with oppor Owner %2", ssmmOpportunityTable.OpportunityId, ssmmOpportunityTable.ownerName() ) ); } while select count(LeadId) from leadTable group by leadTable.OwnerWorker { Info(strFmt("Number of Records Lead %1 with lead owner %2", leadTable.LeadId, leadTable.ownerName() ) ); } }