Hot answers tagged

21 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 = '...
16 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-...
  • 4,767
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 ...
  • 444k
11 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 ...
  • 1,698
9 votes
Accepted

Re-entering a Journey (Journey Builder SFMC)

This sounds like a "high water-mark" issue. Was new data added to the data extension? If not, the Interaction or Fire Event activity may be running as intended, but not detecting new rows ...
  • 1,265
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 ...
8 votes
Accepted

Firing Events in Journey Builder

For simplicities' sake, the second option is the way to go. I understand it can be a bit 'clear as mud'. :) Fire Events point to a sendable DE. That sendable DE should be in the contact model (...
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 ...
  • 13.3k
7 votes

Is it possible for nested subcomponents to receive events from parent components in Lightning?

There is a lot going on in this post so I'll give you some thoughts but can't answer everything. 1. The preferred way for parent to child communication is to use <aura:method>. See https://...
7 votes
Accepted

Implement Domain Event Pattern in Apex - can and should it be done?

It's a powerful pattern, and when leveraged properly opens up a completely different programming paradigm. We've used this to do a lot of heavy lifting in consulting, and also to allow different ...
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(...
  • 444k
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 ...
  • 144k
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,...
  • 301
6 votes
Accepted

Apex Code to create recurring event salesforce

See the salesforce documentation on the Event object. It looks like you are trying to do a 'RecursDaily' type of event. According to the documentation above (and in particular the table located at ...
  • 1,090
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"> <...
  • 53.3k
6 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" ...
  • 4,056
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....
6 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 ...
6 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 ...
  • 13.3k
6 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 ...
5 votes
Accepted

Analytics: how to use Activity (Task / Event) in a Dataset?

I don't believe these objects are supported by Salesforce Analytics as per the Wave Data Integration Guide - Page 15. You can also see Unsupported Salesforce Objects and Fields via below link https://...
5 votes

Why is this trigger to prevent event deletion not executing correctly?

+1 for Adrian's answer. But when adding triggers to standard objects that are likely to be used by many apps in an org, it makes sense to not penalize those other apps with extra SOQL calls. So for ...
  • 131k
5 votes
Accepted

Lightning Components: Firing a nested/child component's methods from the super/parent component?

I guess the application events should just work .I feel you are messing a bit with the syntax . Lets try correcting it The application events are fired as below //super-component_controller.js ({ ...
5 votes

How can I add an event redirecting to a record to a Lightning component?

Use force:navigateToSObject Documentation redirectToSobject: function (component, event, helper) { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "...
  • 22.1k
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,...
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 ...
  • 28.4k
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"> ...
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'...
5 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 ...
  • 129
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 ...
  • 88.1k

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