function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vamsi krishna 106vamsi krishna 106 

I want fire a alert when new record is inserted in custom object in the lightning?

When user update a record(update will done by community user).Same record can view by multiple internal  users. whoever is viewing the that record i need to show alert or toaster to those user.

any suggestons.

Thanks
Vamsikrishna B.
VinayVinay (Salesforce Developers) 
Hi Vamsi,

You can use inline VF page on standard layout and popup alert whenever field is updated.

Below is the same snippet for opportunity.
<apex:page standardController="Opportunity">
ISCHANGED(Date__c)
<script type ="text/javascript">
{
window.alert("Alert");
}
</script>
</apex:page>

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Ayush ShuklaAyush Shukla
You can use Platform Events (https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_intro.htm) to implement the requirment. Try doing following 
  1. Setup a Platform Event and fire(publish) the event from trigger (https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_publish_apex.htm) when community user updates the record . 
  2. Suscribe to that platform event in the lightning component (https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_subscribe_lc.htm)and show a toast when event is received. 
You can go through the documentation mentioned in links above. This should give good idea of using platform events. 
 
Phantom BlackberryPhantom Blackberry
Great articles thanks for sharing this awesome blogs https://www.tellthebell.one/