Skip to main content

Questions tagged [empapi]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
53 views

Subscribing to custom event channel with enriched fields

Using LWC I'm trying to subscribe to a custom event channel. Unfortunately, I'm getting the "The channel specified is not valid" error. I created a custom event channel and event channel ...
mgrab's user avatar
  • 21
0 votes
1 answer
59 views

Async implementation of EmpApi's Subscribe method

Need to wait the Subscribe operation to be done to get the message from Platform Event to use that message in the Apex call in LWC. You can check the code below. // Apex method call to insert metadata ...
batuayyildiz's user avatar
2 votes
1 answer
409 views

empAPI unsubscribe not working LWC

I am using the empAPI module in LWC and 99% of the code is working. The subscription, receiving of events, etc. all work -- except the unsubscribe method. It is very important for me to unsubscribe ...
Rory's user avatar
  • 429
2 votes
1 answer
370 views

Does a Managed Package LWC that subscribes to platform event need the namespace?

I have a platform event in my managed package. My_Platform_Event__e I have a LWC that subscribes to it. For this LWC to work in subscriber org, does my LWC need to include the namespace? i.e. In my ...
Nick C's user avatar
  • 6,790
2 votes
0 answers
1k views

My LWC (with Emp API implemented) stops receiving Platform Events after some time (6-10 minutes) from the time we opened the page Dev Org

-------------- Info ------------ I have one LWC, where I subscribe to Platform Events using lightning/empApi . Here the JS code from the LWC : import { LightningElement } from 'lwc'; import { ...
Vitalii Dehnerys's user avatar
2 votes
1 answer
5k views

Getting the "empApi setting initialized true for : undefined" log in JS console?

I have one LWC, where I subscribe to Platform Events using lightning/empApi . Here the JS code from the LWC : import { LightningElement } from 'lwc'; import { subscribe, onError} from '...
Vitalii Dehnerys's user avatar
1 vote
0 answers
123 views

CometD in Salesforce Mobile?

I have an app using empApi for desktop subscription to a Platform Event, and the version for Communities replaces empApi with cometD. I'm struggling to find an option for Salesforce Mobile. empApi ...
PatMcClellan__c's user avatar
0 votes
2 answers
706 views

LWC - Cannot Invoke Apex wire service after receiving response from Platform Event using empApi

I am using LWC component in Case Record Page to show Warning Messages. There is no user interaction in this component. Case_Team__c is a Child Object to Case and when data is inserted/deleted/updated ...
Venkat K's user avatar
1 vote
0 answers
59 views

Update LWC field from future/queuable Apex [duplicate]

I have something here which I thought would be simple but is turning out to be a nightmare. I've created an LWC Setup page where a user can create an Account (it's nothing more than an input field and ...
bcarroll2k3's user avatar
1 vote
1 answer
695 views

CDC subscription not working in Lightning Web Component

I have enabled the Change Data Capture for my Custom_Object__c and I am trying to subscribe to these events from a Lightning web component using EmpApi of the LWC framework. Here is my code. // ...
Rahul Gawale's user avatar
  • 12.2k
0 votes
1 answer
811 views

How to retrieve platform event received in last 5 min or based on custom field catchKey__c? [closed]

We are going to use platform event for our API response which will be directly consumed using empAPI, Just have few question can we retrieve specific event other than replayId field ? Can we retrieve ...
Ragul's user avatar
  • 541
1 vote
0 answers
397 views

lightning/empApi: clarification on replayId param in subscribe method

The LWC Docs describe the replayId parameter in the lightning\empApi subscribe method as follows (emphasis is mine): Indicates what point in the stream to replay events from. Specify -1 to get new ...
Matthew Souther's user avatar
1 vote
1 answer
300 views

How to update global variable in emp-api

I need to update a global variable when a push topic is created. import { LightningElement, track,api } from 'lwc'; import { subscribe, unsubscribe, onError, setDebugFlag, isEmpEnabled } from '...
Manoj's user avatar
  • 444
3 votes
1 answer
927 views

LWC + Apex from EMP Api callback : Firing dispatch event or an apex call from Streaming api callback fails in LWC, any workaround?

When a dispatch event or an imperative apex call is made from a streaming api callback, then it throws this error in browser console window and reloads the page . {"event":{"descriptor&...
Nagendra Singh's user avatar
0 votes
0 answers
249 views

How to keep the session alive while subscribing push topic using lightning empApi?

I have a requirement to subscribe to push topic for which i have implemented using lightning empApi and have open the browser in a VM for continuous reading of events and do some actions. The issue is ...
Vivek's user avatar
  • 59
4 votes
1 answer
862 views

How to use LMS & EMP-API in the same LWC component

As both empApi and LMS require the import of the subscribe and unsubscribe methods. How can you use both within the same component? import { subscribe, unsubscribe} from 'lightning/empApi'; import { ...
J Dubbs's user avatar
  • 402
1 vote
1 answer
1k views

showToast from messageCallback function of empApi

I have an empApi subscription to a Platform Event. When that event fires, I want to pull data from its fields and showToast. I'm copying the code straight from the docs, and I can get the platform ...
PatMcClellan__c's user avatar
3 votes
1 answer
1k views

Test lightning-emp-api

Can we simulate an event subscription in LWC unit test? I have a lightning web component using lighting/empApi like, export default class ExampleComponent extends LightningElement { ...
shunkosa's user avatar
1 vote
1 answer
236 views

Empapi lightning web component callback which type

I am developing a simple component to call external service in AWS Which will create PDF file in the s3. When the PDF is created the service will change the object status. Is it possible to use empapi ...
Shinya Koizumi's user avatar
3 votes
1 answer
7k views

LWC - empApi for publishing and subscribing platform event from Lightning web component

I am new to LWC and trying to implement empApi for publishing and subscribing platform event from LWC. Salesforce provided an example on: https://developer.salesforce.com/docs/component-library/...
Prabhjot Singh's user avatar
1 vote
1 answer
1k views

LWC emp API track field is not rendering

I am trying with small example of emp API, everything works fine I am able to subscribe and unsubscribe, however, the response of CDC not printing in the UI for some reason. May I am missing a small ...
Ajay 's user avatar
  • 1,609