Hot answers tagged

11

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. ...


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 ...


8

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> ...


7

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 ...


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.               ...


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

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....


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....


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

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 ...


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

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.get("value") { case "1": helper.doEdit(); break; case "2": helper.doDelete(); break; } } }) The previous method ...


5

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> &...


5

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 ...


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 ...


4

Something like this should work. I did this in a text editor so there could be some syntax issues. Trigger EventBefore on Event(before insert, before update){ Map<Id, List<Event>> whatIds = new Map<Id, List<Event>>{}; For (Event e : trigger.new){ If(e.WhatId == null || e.What.Type != 'Account'){ ...


4

Streaming API is long polling for salesforce; normal polling won't work here. Using the normal REST API's updated/deleted functions work once per call, so you won't have real-time status updates. On the other hand, the Streaming API has its limits as well, so if events are constantly generated, you may run into those limits.


4

AFAIK this is unexpected behavior and should be logged with support. There isn't any reason I've seen for why a list view button should behave any differently with respect to record type selection. Update and Workaround For reasons unknown (and which feel like a bug) all activity new task/event buttons skip the record type selection page.  As the ...


4

I see a few potential errors in the code. onSelectChange should be change, and value should be text. Please try this: <aura:handler name="init" value="{!this}" action="{!c.doInit}"/> <aura:attribute name="contacts" type="Contact[]"/> <ui:inputSelect aura:id="o" label="Contacts" change="{!c.onSelectChange}"> <aura:iteration items="...


4

Your logic will be easier to understand if you use the Set.contains method: Set<Id> profileIdWhitelist = new Set<Id>(); for (Profile whitelistedProfile : [SELECT Id FROM Profile]) // WHERE ... profileIdWhitelist.add(whitelistedProfile.Id); if (!profileIdWhitelist.contains(UserInfo.getProfileId()) { for (Event event : trigger.old) ...


4

There's an even easier way to abort early. Simply query for profiles that match a certain name and also match the user's current profile. If the result is non-zero, that means the user is authorized to delete the events. trigger PreventEventDeletion on Event (before delete) { Event validEvents = new Event[0]; for(Event event: Trigger.old) { ...


4

This problem has a very simple solution, but first we need to understand the reason. You are using trigger context variables in iteration and trigger context variables i.e. trigger.new, trigger.old etc. do not query value of relationship field. So you can access e.AccountId, e.WhoId but not e.Account.Name or e.Who.Name. This is applicable to all triggers not ...


4

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 ...


4

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.someAction}"/> Your button would use it like this: <button class="some class" onclick="{!v.press}" >press me!</button> The parent component ...


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