Hot answers tagged

15

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-notifications/. A month ago I had a task to send a notification to my user when deletion of test data is finished. This is an example code how it was done: public ...


12

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 will be in the "executing" phase at any given time. Synchronous Once an event has been fully handled, the event queue is checked and the next event is fired. ...


12

From Winter 2021 you will be able to send notifications directly using apex. The below code works in the winter 2021 release preview orgs. Id typeId = [SELECT Id FROM CUstomNotificationType WHERE DeveloperName = 'notification type name'].Id; Messaging.CustomNotification notification = new Messaging.CustomNotification(); notification.setBody('This is body of ...


10

It is easy, just follow this steps: 1) First create a new Visualforce page. Go to Setup - Develop - Pages and click on the New button. For standrard controller select Event. Save the page: 2) Now go to the standard event page layout and edit it: 3) Over there in the Visualforce Pages area find your page. But insert a new section first. Then just drag and ...


9

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 script Try below code <div style="border: green solid 3px;" onclick="{!c.logData}"> <br/> <br/> <br/> </div> ...


8

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 (Contact Builder) as a 'root' data source. Generally you'd like it mapped 1:1, though that is no longer a requirement. Unless you've got a specific use case ...


8

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 Present Time Hope this might helps....


7

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://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_cmp_methods.htm It should be a bit simpler than using events. 2. You declare changeEvent.evt ...


7

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 packages to communicate with each other using domain events as glue between services.               ...


7

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 because they were not added. Journey Builder tracks the last event processed for the event source data extension to prevent individual events from being injected into an ...


7

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(component, event, helper) { switch(event.getParam('value')) { case "1": helper.doEdit(); break; case "2": helper.doDelete();...


7

Pass a JS Object direct into detail const selectedEvent = new CustomEvent('custevent', { detail: { type: "Fiat", model:"500", color:"white" } }); Access the object in your listener method and get the value from object as:- hndlecustEvent(event) { this.value1 = event.detail.type; this.value2 = event.detail.model; }...


6

You are using a different object inside your for loop. I suggest you do this: trigger createnewCalendarEvent on mBooking__c (after insert) { list<Event> addEvents = new List <Event>(); for (mBooking__c mb: Trigger.new) { addEvents.add(new Event( StartDateTime = mb.mDate__c, EndDateTime = mb.mDate__c, Subject = '...


6

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 the bottom of the page), that means you should also be populating the RecurrenceInterval field. So your code would be: Event newEvent = new Event(); newEvent....


6

Add an onclick to the div and use something similar to (Pardon my naming): Component <aura:component description="myProblemComponent" implements="flexipage:availableForAllPageTypes"> <div style="display:inline-block;margin-right:10px" onclick="{!c.openPicker}"> <lightning:icon iconName="utility:event"/> </div> &...


6

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 standard objects that support triggers, such as a Contact or an Account, some standard child objects, such as a CaseComment, and custom objects. To define a trigger, ...


6

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" error in your developer console, please turn off notifications for your org: From Setup, enter Notifications in the Quick Find box, then select ...


6

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.body}" filename="{!newAtt.name}" onchange="checkFileSize(event,id)" /> <script> function checkFileSize(event , id ) { if(event.target....


6

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, but it's a pretty simple process builder. https://developer.salesforce.com/blogs/2019/06/get-buildspiration-with-custom-notifications-in-summer-19.html ...


5

The reason the event is not coming up in the Open Activities is because the activityDateTime field in the Event will be set to the createdDate, unless you explicitly set it. This will cause the Event to appear in the Activity history Related List. To resolve this issue you have to set the ActivityDateTime field to the event start date while creating the ...


5

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://help.salesforce.com/HTViewHelpDoc?id=bi_integrate_salesforce_extract_transformation_unsupported_objects_fields.htm&language=en_US Import into Wave - Best ...


5

+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 this case something like the code below will only do the query when necessary: trigger PreventEventDeletion on Event (before delete) { Set<Id> ...


5

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 ({ fireEvent: function(component){ var myEvent = $A.get("e.c:myEvent"); myEvent.fire(); console.log('event fired'); } }) Nested component handling <...


5

Use force:navigateToSObject Documentation redirectToSobject: function (component, event, helper) { var navEvt = $A.get("e.force:navigateToSObject"); navEvt.setParams({ "recordId": "00QB0000000ybNX", "slideDevName": "Detail" }); navEvt.fire(); } recordId: Required. The record ID. slideDevName: Specifies the slide within ...


5

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,opportunity or custom object reference


5

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"> <aura:registerEvent name="StartQuiz" type="c:StartQuizEvent"/> <button class="slds-button slds-button_brand" onclick="{!c.StartQuiz}">Commencer le ...


5

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'm going to investigate that further. However, for now, this should work as long as the sforce.console is defined (I would have thought it wouldn't be ...


5

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 the cometd.js client lib. Note... before that happens.... in a connect listener I am seeing at 403::Unknown Client message.. then the cometd tries to ...


5

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 watched by one or more subscribers. They aren't independent objects, they don't store state, and they have no permanence - they simply represent some occurrence ...


5

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 child to parent. Let's understand it better. See the below code:- import { LightningElement, track, wire } from 'lwc'; import getContactList from '@salesforce/...


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