Skip to main content
27 votes

Bell notifications via apex

From Winter 2021 you will be able to send notifications directly using apex. The below code works with winter 2021 and later. Id typeId = [SELECT Id FROM CUstomNotificationType WHERE DeveloperName = '...
Rahul Gawale's user avatar
  • 12.2k
18 votes

Bell notifications via apex

You can definitely send Bell Notifications via apex. Andrew Fawcett explained this feature in detail in his article https://andyinthecloud.com/2019/06/30/getting-your-users-attention-with-custom-...
Eduard's user avatar
  • 5,161
12 votes
Accepted

Process Builder - Add Minutes,Hours to Event End Date

Use the Formula like Now() + (60/24/60) Give your required minutes in first 60. If you want for 10 minutes to be added, Give like Now() + (10/24/60) Then you will get the 60 minutes added to the ...
Subhash's user avatar
  • 1,716
12 votes
Accepted

Are lightning event synchronous or asynchronous?

Are lightning event synchronous or asynchronous? Yes. Asynchronous When fire() is called, the event is placed in to a queue for later execution. Atomic Until canceled or completed, only one event ...
sfdcfox's user avatar
  • 497k
12 votes
Accepted

ShowToastEvent notification is not displayed in LWC

As you can see here platformShoToastEvent can only be used in Lightning Experience explicitly. Since standard toasts are based on Appliacation Events there is nothing to handle your event in Lightning ...
Bartosz Śliwiński's user avatar
9 votes
Accepted

Lightning Components: What is the easiest way to have an onclick event on a HTML-tag?

Inline Javascript is not supported due to security threat and you can simply use onclick event and always follow the Unobtrusive principles.You can look at document here which mentions to avoid inline ...
Mohith Shrivastava's user avatar
8 votes
Accepted

How to send multiple parameters to Event in LWC

Pass a JS Object direct into detail const selectedEvent = new CustomEvent('custevent', { detail: { type: "Fiat", model:"500", color:"white" } }); Access the object ...
sanket kumar's user avatar
  • 15.4k
7 votes

How to handle lightning:buttonMenu onselect event to identify edit or delete?

Update (API Change) In order to determine which menu item was used, check the event's "id" and "value" parameters to determine which meny item was used: ({ handleSelect: function(...
sfdcfox's user avatar
  • 497k
7 votes
Accepted

System.FinalException: Record is read-only. How to update fields in event object?

Field updates belong in a before trigger and do not require additional DML operations. I suggest you have a read of Triggers from the Apex Developer Guide: You can define triggers for top-level ...
Adrian Larson's user avatar
  • 151k
7 votes
Accepted

CometD Issues when subscribing to Platform Events

This is a know issue documented in the Platform Event project Build an Instant Notification App: If you notice an "Exception during handling of messages Unrecognized advice action handshake" ...
POZ's user avatar
  • 4,419
7 votes

Bell notifications via apex

You can achieve the bell notification through the new Summer '19 Custom Notifications feature however, it's not triggerable via APEX just yet. I know this doesn't directly answer the question re: APEX,...
GeorgeBT's user avatar
  • 301
7 votes
Accepted

Fire an event when the page has loaded with all the assignation

renderedCallback called after every render of the component. This lifecycle hook is specific to Lightning Web Components, it isn’t from the HTML custom elements specification. This hook flows from ...
sanket kumar's user avatar
  • 15.4k
7 votes
Accepted

Platform Events- Event Delivery Limit for Simple Use Case

If I have 1000 users on SF and they receive every event and 51 calls come in == 51 published platform events to 1000 waiting users won't I go past the limit? Yes the number of events delivered would ...
Mohith Shrivastava's user avatar
6 votes
Accepted

Treat click event on <lightning:icon> as a click on <ui:input>

Add an onclick to the div and use something similar to (Pardon my naming): Component <aura:component description="myProblemComponent" implements="flexipage:availableForAllPageTypes"> <...
Eric's user avatar
  • 54.2k
6 votes

CometD Issues when subscribing to Platform Events

I'm receiving this message as well. Not in the Trailhead but in my own code both within Visualforce page and withing a lightning component. I don't think you can catch this exception as it's caught by ...
ChiCloud's user avatar
  • 159
6 votes
Accepted

How to clear the filename and value of apex:inputFile

You can pass the element id in the checkFileSize method, and then do your processing then <apex:page controller="FileUploadController"> <apex:inputFile id="inputfile" value="{!newAtt....
Pranay Jaiswal's user avatar
5 votes
Accepted

Fill the WhoId and WhatId fields when create an event

WhoId for an event has to be leadId or a contactId. Create a contact record Contact cnt = new contact(); Cnt.LastName = 'Test '; Insert cnt ; Even.whoId = cnt.Id; WhatId can be account,...
Mohith Shrivastava's user avatar
5 votes
Accepted

Putting a barcode in a Marketing Cloud email

You can do this with the BarCodeURL() AMPScript function: <img style="width: 400px;" alt="WHEE" src='%%=BarCodeURL('WHEE','Code39', 400, 200, 0)=%%' width="400"> Reference: AMPScript Function ...
Adam Spriggs's user avatar
  • 30.8k
5 votes
Accepted

Application Event not firing in lightning

You should define the name of the application event in javascript controller same as the application event name. <aura:component implements="flexipage:availableForAllPageTypes" access="global"> ...
Ajay Prakash Dubey's user avatar
5 votes

Onclick handler doesn't fire in dynamically-added dom element

I was able to get something to work by calling addEventlistener rather than setting an attribute. However, I wasn't able to add a regular Lightning controller function via component.getReference() - I'...
Caspar Harmer's user avatar
5 votes
Accepted

Platform Events- Length of time an event is published for?

Platform events are inherently momentary. They don't have a duration as such, but they are stored on the platform for 24 hours to facilitate replay. Events exist in a channel, a stream, which is ...
David Reed's user avatar
  • 93.2k
5 votes
Accepted

SOQL aggregate functions do not work with Task.ActivityDate

I have found a workaround by creating a custom field of type date under the Activity object called ActivityDate__c. Thus we can reformulate the initial query as SELECT WhoID, COUNT(Id), MIN(...
catalandres's user avatar
5 votes
Accepted

Bell notifications via apex

I am not sure if it is the best approach, but I had a situation very close of that. I needed to create a notification for an user linked with a Case. List<FeedItem> FeedItemList = New List&...
m Peixoto's user avatar
  • 1,098
5 votes

One trigger per object is commonly espoused as best practice, but is that so for event triggers as well?

A short answer based on my experience In SFDC, you can have multiple subscribers to a platform event - these could be n triggers, or a trigger and a process builder, or ... You need to think about ...
cropredy's user avatar
  • 72.1k
4 votes
Accepted

Implement press="c.someMethod" on a custom component

You need to make the attribute of type AuraAction. This will enable you to pass in the handler action directly. Define it like this: <aura:attribute name="press" type="Aura.Action" default="{!c....
Caspar Harmer's user avatar
4 votes

How to limit a query on Event based on Opportunity standard field - StageName

Since you can not directly query this on Event as your what Id can be any object. What you can do is first query the opportunity List<Opportunity> opp = [select Id from Opportunity where ...
salesforce Developer's user avatar
4 votes

Not able to create lookup relationship of same object on Activity Object

Because of the complexity of the Activity objects, you're only allowed one lookup to a specific type of object (e.g. User) for custom activity lookup fields. There is no workaround or resolution. You ...
sfdcfox's user avatar
  • 497k
4 votes
Accepted

EventWhoIds is not writeable in apex class but working on JSForce

The field EventWhoIds is only available at all if you have the "Allow Users to Relate Multiple Contacts to Tasks and Events" setting turned on in Activity Settings. It's an API convenience field of ...
David Reed's user avatar
  • 93.2k
4 votes
Accepted

EventRelation - Insert error. You can only add up to one what relation

The Shared Activities feature allows you to associate multiple Contacts (up to 50) to an Activity through the WhoId, table-ized as EventRelation and EventWhoRelation. It does not allow you to ...
David Reed's user avatar
  • 93.2k
4 votes
Accepted

Can't call helper function from helper inside list forEach

This is the case of lexical scoping. You limiting the scope of callback function by using function(). Instead change it to below: dataComplex.forEach((d) => { Arrow function does'nt has its own ...
salesforce-sas's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible