can we do like displaying chat bubble for chat queues and remaining let it be email......the logic for fetching chat queue is there in the apex class.. NEED HELP!!!!
public class QueueInfo{ @AuraEnabled public string publicGroupId; @AuraEnabled public string publicGroupName; @AuraEnabled public string QueueType; @AuraEnabled public String publicGroupCreated; @AuraEnabled public Date CreatedDate; public QueueInfo(){ publicGroupId=''; publicGroupName=''; publicGroupCreated =''; QueueType = ''; } } @AuraEnabled public static List <QueueInfo> fetchQueue () { List <Group> returnList = new List <Group> (); List <Group> lstOfGroup = [select Id,Name,CreatedDate from Group where type='Queue' LIMIT 500]; //List <QueueSobject> lstOfGroup = [SELECT Queue.Name,QueueId,SobjectType FROM QueueSobject WHERE Queue.Name like '%AMERICAS%' LIMIT 500]; list <QueueInfo> QueueInfoList = new List<QueueInfo>(); list <QueueSobject> lstqueueid; QueueInfo pubGrpinfo; for (Group u: lstOfGroup) { pubGrpinfo = new QueueInfo(); pubGrpinfo.publicGroupId = u.Id; pubGrpinfo.publicgroupName = u.Name; //pubGrpinfo.QueueType = u.SobjectType; pubGrpinfo.publicGroupCreated = u.CreatedDate.format('dd-MMM-YYYY'); QueueInfoList.add(pubGrpinfo); } system.debug(QueueInfoList); Set<id> idQueue = new Set<id>(); for(Group qid: lstOfGroup) { idQueue.add(qid.Id); } String ChannelType; List <QueueSObject> queuetype = [SELECT QueueId, SobjectType, Queue.name FROM QueueSobject where SobjectType='LiveAgentSession' and QueueId in: idQueue LIMIT 500 ]; for (QueueSObject qo: queuetype ){ String Channel = qo.SobjectType; system.debug('Channel---->' + Channel); Boolean isEmail=Channel.contains('LiveAgentSession'); system.debug(isEmail); if (isEmail){ ChannelType = 'Chat'; }
<lightning:icon iconName="utility:email" />
apex class condition-
if (isEmail){
ChannelType = 'Chat';
}
NEED HELP!!!!
Thanks
<td scope="row" style="width: 200px;"><div class="slds-truncate" ><a><lightning:icon iconName="utility:email" /></a></div></td>
Thanks let us know if it helps you
http://sfdcMonkey.com
update yourVarName with your aura:iteration variable name
thanks
Is there any other alternative for this?
Thanks
NEED HELP!!!!
Component –
<table class="slds-table slds-table_bordered slds-table--header-fixed">
<thead >
<tr class="slds-text-title_caps" >
<th scope="col"><div class="slds-truncate slds-cell-fixed" style="width: 275px;padding-top: 10px;" title="Channel">Channel</div></th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.SearchAllQueueResult}" var="queue" indexVar="count">
<tr>
<td scope="row" style="width: 200px;"><div class="slds-truncate" ><a><lightning:icon iconName="{!v.SearchQueueKeyword == 'chat'? 'utility:chat' : 'utility:email'}" /></a></div></td>
</tr>
</aura:iteration>
</tbody>
</table>
Apex class-
public class QueueInfo{
@AuraEnabled public string publicGroupId;
@AuraEnabled public string publicGroupName;
@AuraEnabled public string QueueType;
@AuraEnabled public String publicGroupCreated;
@AuraEnabled public Date CreatedDate;
public QueueInfo(){
publicGroupId='';
publicGroupName='';
publicGroupCreated ='';
QueueType = '';
}
}
@AuraEnabled
public static List <QueueInfo> fetchQueue () {
List <Group> returnList = new List <Group> ();
List <Group> lstOfGroup = [select Id,Name,CreatedDate from Group where type='Queue' LIMIT 500];
//List <QueueSobject> lstOfGroup = [SELECT Queue.Name,QueueId,SobjectType FROM QueueSobject WHERE Queue.Name like '%AMERICAS%' LIMIT 500];
list <QueueInfo> QueueInfoList = new List<QueueInfo>();
list <QueueSobject> lstqueueid;
QueueInfo pubGrpinfo;
for (Group u: lstOfGroup) {
pubGrpinfo = new QueueInfo();
pubGrpinfo.publicGroupId = u.Id;
pubGrpinfo.publicgroupName = u.Name;
//pubGrpinfo.QueueType = u.SobjectType;
pubGrpinfo.publicGroupCreated = u.CreatedDate.format('dd-MMM-YYYY');
QueueInfoList.add(pubGrpinfo);
}
system.debug(QueueInfoList);
Set<id> idQueue = new Set<id>();
for(Group qid: lstOfGroup)
{
idQueue.add(qid.Id);
}
String ChannelType;
List <QueueSObject> queuetype = [SELECT QueueId, SobjectType, Queue.name FROM QueueSobject where SobjectType='LiveAgentSession' and QueueId in: idQueue LIMIT 500 ];
for (QueueSObject qo: queuetype ){
String Channel = qo.SobjectType;
system.debug('Channel---->' + Channel);
Boolean isEmail=Channel.contains('LiveAgentSession');
system.debug(isEmail);
if (isEmail){
ChannelType = 'Chat';
}
system.debug('Type--->' +ChannelType);
}
system.debug(queuetype);
return QueueInfoList;
}