0

I am trying to get the related Case.Origin from MessagingSession, whenever I do the query on dev console or salesforce inspector, I can get the Case.Origin. However on my actual code it doesn't return any Case.Origin to my lwc

Here is my code:

Apex:

List<MessagingSession> messagingSessions = new List<MessagingSession>();
messagingSessions = [SELECT Id, Case.Origin, CaseId, Status, StartTime, EndTime
                                FROM MessagingSession 
                                ORDER BY StartTime DESC];  
return messagingSessions;

LWC:

for(c in response.messagingSessions){
  let o = response.messagingSessions[c];
  this.id = o.Id;
  this.origin = o.Case.Origin;
  this.caseId = o.CaseId;
  this.status = o.Status;
  this.startTime = o.StartTime;
  this.endTime = o.EndTime;
}

I am getting values on id, caseId, status, startTime & endTime however the origin is blank. But whenever I perform the query on dev console or salesforce inspector the Case.Origin has values

2
  • 2
    Have you attempted to log the messaging session record that you're receiving in the LWC? Or is that how you've determined that it is coming through as null? Mar 29 at 2:14
  • 1
    Your query works for me in exec anon...have you shared all the relevant detail? Otherwise I'd be guessing it's a data or permission issue.
    – Girbot
    Mar 29 at 6:40

0

You must log in to answer this question.

Browse other questions tagged .