Skip to main content Join the Agentforce Virtual Hackathon to build innovative solutions and compete for a $50k Grand Prize. Sign up now. Terms apply.

#Platform-events1 discussing

A State Processing Engine

Here’s how I built a flow-based state processing engine using platform events. It allows for high volume asynchronous processing of records that will come from an integration.

https://www.freelikeapuppy.tech/post/a-state-processing-engine

A State Processing EngineHere’s how I built a flow-based state processing engine using platform events. It allows for high volume asynchronous processing of records that will come from an integration.

 

 

 

@Nonprofit and Education MindShare @MVP Office Hours (US) @Admin Group, West Chester, US @Nonprofit User Group, Philadelphia, US @Admin Group, Philadelphia, US

 

 

#Platform-events

0/9000

What I've Learned about Platform Events

Platform Events are a great tool to add to the admin's toolkit, but they take a moment to wrap your head around. And for those of us that are declarative-only, their strong scent of "developery-ness" adds to the wariness. But once you break them down, they can be pretty handy!

https://www.freelikeapuppy.tech/post/what-i-ve-learned-about-platform-events

 

What I've Learned about Platform EventsPlatform Events are a great tool to add to the admin's toolkit, but they take a moment to wrap your head around.

 

 

@Salesforce MVP Collaboration Space @Admin Group, Philadelphia, US @Nonprofit and Education MindShare @Nonprofit User Group, Philadelphia, US @Admin Group, West Chester, US

 

 

#Platform-events

0/9000

Its showing toast message but also showing this error box always ,I cant get why its showing 

 

Getting [NoErrorObjectAvailable] Script error.

import { LightningElement, track } from 'lwc';

import { subscribe, unsubscribe, onError } from 'lightning/empApi';

import { ShowToastEvent } from 'lightning/platformShowToastEvent';

export default class SubscribeToPlatformEvent extends LightningElement {

@track showMessage = false;

@track message = '';

channelName = '/event/Tata_Tele_Services__e';

isComponentConnected = true;

connectedCallback() {

onError(error => {

console.error('EMP API error: ', JSON.stringify(error));

});

}

subscribeToPlatformEvent() {

try {

const messageCallback = response => {

console.log('Message received:', response);

try {

if (!this.isComponentConnected) {

// Component is disconnected, no need to process the event

return;

}

const agentNumber = response.data.payload.Agent_Number__c

// Display a toast message for every incoming call

const toastEvent = new ShowToastEvent({

title: 'Incoming Call',

message: `Incoming call from ${agentNumber}`,

variant: 'info',

});

console.log('Successfully subscribed to : ', toastEvent);

if (this.isComponentConnected) {

this.dispatchEvent(toastEvent);

}

console.log('Successfully subscribed to : ', this.dispatchEvent);

} catch (error) {

console.error('Error handling message: ', JSON.stringify(error));

}

};

// Subscribe to the Platform Event

subscribe(this.channelName, -1, messageCallback).then(response => {

console.log('Successfully subscribed to : ', JSON.stringify(response));

});

} catch (error) {

console.error('Error subscribing to platform event: ', JSON.stringify(error));

}

}

// Unsubscribe when the component is destroyed

disconnectedCallback() {

this.isComponentConnected = false;

unsubscribe(this.channelName);

}

}

HTML

<template>

<lightning-card title="Incoming Call">

<div class="slds-m-around_medium">

<!-- Remove "utility:" prefix from icon-name -->

<lightning-icon icon-name="down" size="small"></lightning-icon>

<lightning-button label="Subscribe" onclick={subscribeToPlatformEvent}></lightning-button>

<div if:true={showMessage}>

<p>{message}</p>

</div>

</div>

</lightning-card>

</template>

#Integration  #Platform-events  #LWC  #LWC Framework

4 answers
  1. Nov 6, 2024, 7:37 AM

    The [NoErrorObjectAvailable] Script error you're seeing, suggests that there's an issue with a script running in your Salesforce org. This error commonly arises in situations where there is an uncaught JavaScript exception or an issue in the LWC component that is affecting the user interface.

     

    These steps may help resolve your issue,

    1. Check Browser Console for Details

    The error message itself, [NoErrorObjectAvailable], is a generic one, so it doesn’t provide much specific information. However, opening your browser's developer console might show more detailed error logs.

     

    2. Put the code in try-catch block where the potential error lies. It is always recommended to use try-catch in your code to catch this type of error.

     

    You can follow this link for more understanding : 

     

    Please mark this answer as helpful, if it solves your query.

0/9000

Hi All,

We wish to create an automation which tests if a certain platform event has been fired successfully or not.

However, unable to figure out if there is any object/soql that can help us assert that.

Just to add more, there is no subscriber of this event in salesforce itself.

 

Any approaches?

Thanks

 

#Integration  #Salesforce Developer  #Platform-events

2 answers
0/9000

On January 18, Salesforce and Vivid GovTech experts will guide you through the intricacies of the permitting process, offering insights, best practices and live demos. Whether you're a business owner or a GOVERNMENT official, empower yourself to streamline the journey from start to finish. Register here: Navigating the Maze with Salesforce and Vivid GovTech - View (carahsoft.com)

0/9000

We have a record trigger flow creating a Platform Event.  If the a textfield is null (blank), the payload from the Platform Event is showing None.  How can we fix this to show ''?

2 answers
  1. Dec 29, 2023, 1:23 PM

    What we really want is an empty string instead of it saying None.  We can't figure out where None is coming from.  We are using a text field.

0/9000

Hi All, I have been reviewing the platform event usage of an org and I noticed that limit on 'Event Publishing' was more than 500,000 a day while the limit of the org is 250,000 as mentioned below.

"Event Publishing: maximum number of event notifications published per hour : 250,000"

Do you know if this limit is a soft limit as we have not noticed any process failing due to the breach of this limit.

#Platform-events #GovernorLimits

4 answers
  1. Nov 29, 2023, 7:16 AM

    These are a mix of events including the change type as well as custom platform events. These are regarding the 'publish' events. Most of the instances are of CHANGE_TYPE for record changes of object like account.

0/9000

I've been testing with ChangeEvents and Change Data Capture in my sandbox and I've been running into some weird behaviour when trying to playback old events. 

 

I updated a 1000 accounts and made sure not much other changes where made to accounts afterwards, the first 2 days I could retrieve the accounts via replayId no issue. After receiving the last 100 updated accounts and sending another call to fetch changes I would get back an empty message and nothing was added up to my delivered event limits.

 

However on the 3rd day before hitting the 72 hour limit, I tried to fetch the accounts using ReplyId as I did before. However after the last 100 updated accounts where fetched sending another message did not result in an empty message as a response instead I got another message with changes and a absurd amount of delivered events was added to my limit something along the lines of 24.000 even though over those 3 days no more then 550 events where delivered according to the platformusagemetrics records. What could have caused this?

 

#Salesforce Developer #Change Data Capture #Platform-events #Developer Forums #Integration

1 answer
0/9000

Hi Everyone,

 

Recently, we enabled the Change Data capture in my Org, i observed the there is difference in no of change events delivered & Published,

 

Today i made 2 accouts update then events published 2 times but when the event Delivered showing as 10 times. 

Also, its only for infomatica team which subscribe the events and they receivd 2 events only. 

 

Is it possible to check where the remiaing 8 events are delivered? i m very new to the CDC and struguling to understand the CDC functioning & limitations too.

 

Could you pelase any one help on this much approciated.

  #Platform-events #CDC Messages @Salesforce Flow Automation #CDC Support #CDC Guarantee Order @Jay Hurst @John Brock

4 answers
  1. Sep 6, 2022, 6:22 AM

    Thank you @Benazir Beham 

     

    I queried the it but its returning the 0 results.

     

    Also, please correct me if any issue in my cdc config.

     

    1. enabled the change data captature for 2 obejct  (Account , Opportunity)

    2. In Informatica, they subscribed the these 2 objects and receiving the changeevent but in my system its showing delivered events more than published.

    @Official: Change Data Capture @* Salesforce Platform * @Jay Hurst  

    @John Brock

0/9000

Is it possible to use Platform Event creation in certain topic and Subscription of Lightning Component to this topic - to Pop-Up the exact object records at the exact User's screen, the same time while the request comes to the REST-service from the external system? This REST-service will create this Platform Event. 

 

The main questions are:  

1) Would the Platform Event be created the same time the request for the creation comes (or any delays are possible - what would be the delay)?

2) Would the Platform Event be read by the subscriber the same time it is created (or any delays are possible - what would be the delay)?  

 

The amount of the Platform Events in this topic is going to be approximately before 40 000 per day.   

 

Business need:  To pop-up records at the user screen "the same time or with low delay" when the event comes from the external system.

 

#Integration #Salesforce Development #Platform-events #Telephony Integration

1 answer
  1. Oct 16, 2021, 10:46 PM

    Hi,

    Platform events and push topics are for real time notifications. When the platform event is published, the subscriber receives it instantly. You can easily test it. 

     

    1. Create a Platform event.

    2. Create a LWC to subscribe to it.

    3. Use Workbench or Developer Console to publish to the Platform events.

    4. Check the LWC whether it is getting it without any delay.

     

    Sample LWC - https://www.infallibletechie.com/2021/10/how-to-subscribe-to-platform-even-using.html

0/9000