Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [executioncontext]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
107 views

Can someone clarify when a Trigger executes on a single record vs. multiple in one context?

This may be a silly question, but I've been surprised by Salesforce enough to potentially look foolish for confirmation! Apologies, the question itself was difficult to phrase. Fundamentally, since a ...
3
votes
2answers
124 views

Is it possible for Apex code to determine whether it is with or without sharing?

As an author of the code, I can, of course, know if the context is with or without sharing when I write my code into a class with either of these keywords. But what if I am writing my code into a ...
1
vote
2answers
82 views

Can I get end of execution context

I have a simple Logger class with a static list of log objects and two methods. One method adds logs to the static list and the other method inserts the list. Right now I am manually calling the save ...
0
votes
1answer
39 views

Salesforce execution flow

i read the steps of execution flow in saleaforce but i am new to salesforce so have confusion at some points. If I have inserted batch of records and i have a after trigger on the same object, which ...
2
votes
0answers
96 views

Workflow needs to run as specific user or profile for field update to work

I have create a form on a Customer Community where users submit records and in turn a time-based workflow is created to change the value of a field on that new record at a certain time. In turn, a ...
0
votes
4answers
132 views

Which users context will SOAP apex class execute in?

I have a SOAP apex class which exposes some webservice methods to be calls from my applications backend. This code has some DateTime methods that return the values based on context user's timezone ...
0
votes
1answer
151 views

Apex execution context and DateTime class

I have a code which does this, Datetime dt = Datetime.NOW(); String starttime = dt.hour(); Now from the apex documentation, now() returns the current datetime based on GMT and hour() returns the ...
2
votes
1answer
344 views

Find user agent string in lightning controller

In Visualforce controllers, we have ApexPages.currentPage().getHeaders() to get info like user-agent, etc... Is there any equivalent for Lightning controllers? I know this info can be found from $...
-2
votes
1answer
287 views

What is the execution time spent in the database for an DML or SOQL or SOSL?

Is it possible to find the execution time for a DML or SOQL or SOSL? What are the factors on which the execution time of these queries depend?
0
votes
1answer
22 views

Can't Code Recursive-ish Single-Object Business Requirement — is it me or the requirement?

Given this background: Firstly, a workflow or something on Contact is already in place that updates Contact.High_School_Lookup__c when a user saves a change to the value of Contact....
0
votes
1answer
92 views

Execution Context Variable Scope In The Tidy Trigger Pattern

I've read through Nuances of Working with Tidy Trigger Pattern, but I'm still struggling to understand something: For what portion of the life of the "execution context" does an attribute of the ...
2
votes
1answer
317 views

Does a lightning component action calling apex always get a distinct execution context?

The documentation on server-side queuing does not explicitly state whether each action gets its own execution context. Neither do the docs on Apex Transaction. The Trailhead on execution context sides ...
21
votes
1answer
819 views

Why use Platform Events in standalone native apps?

In Summer '17 Salesforce released Platform Events - a native messaging system accessible via Apex and several APIs. I assume the main use case for such a feature is to allow integration of Salesforce ...
1
vote
1answer
190 views

Queuable Apex - chaining jobs vs calling other classes synchronously

I'm learning Queueable apex and want to make sure I understand what the benefit of chaining jobs is, as opposed to simply calling other class methods within the method synchronously. Here's my ...
5
votes
0answers
355 views

Can we detect context inside a Lightning Component which has implemented 'force:lightningQuickAction' interface?

While working on a Lightning Component that can be invoked inside a Lightning Record Home Page as well as Quick Actions. But I need to present different User interface in both context of the component....
15
votes
2answers
7k views

Dynamically Determine Calling Context?

We have various ways of invoking apex. Triggers, Inbound Webservices, @InvocableMethod,@RemoteAction and what not. Often we call some or other utility methods from these execution contexts. I have ...
1
vote
3answers
347 views

How are records batched from Time-Based Workflow updates

Wonder how Salesforce handles batching records in relation to execution context. For example, if I have a static variable that tracks the records being processed by a trigger: trigger MyTrigger on ...
1
vote
0answers
157 views

Past due Time-based workflow with criteria set from other workflows

I have a very unique condition happening during a time based workflow that is causing some unexpected behavior. I am curious to know if anyone has had a similar experience and if I am correct in ...
4
votes
2answers
65 views

Is “System.QueryException: non-selective query” Only Thrown From Triggers

Is it true that "System.QueryException: non-selective query" is only ever thrown from a trigger? If so, where is this documented and what happens when an identical query (one that throws "System....
2
votes
1answer
29 views

Number of Execution Contexts during Callouts

I am trying to understand how execution context works with respect to callouts. Use case : Whenever an Account's status is updated to "Ready for Integration", a REST callout will happen towards an ...
11
votes
2answers
1k views

In Apex, what is the difference between the “execution context” and a transaction?

What are the boundaries of the execution context? What are the boundaries of a transaction?
1
vote
1answer
14k views

Update same record in after insert/update in a trigger context

I searched a bit for some informations about the need to make an update on a record in after insert/update trigger context. I found that the common feedback was to move the Business logic in before ...
4
votes
1answer
180 views

Using sObject variables in Execution Context

I started learning about Execution Context and I got this question: Let's say I have a static sObject variable in the beginning of my Execution Context filled by a select. In the middle of the ...
6
votes
3answers
2k views

Can future execution start before the synchronous execution is completed

Is there a way for @future annotated method to start execution before the synchronous request which invokes it has completed. In other words, do I have some guarantees that the timing will look like ...
3
votes
1answer
924 views

How can I create over 10,000 records with information from Visualforce?

I have an inventory input page that I am working on and I am running into an issue where I need to create more than 10k records. The problem here is that all the information needed is not stored in an ...
1
vote
1answer
56 views

What are the tradeoffs of rendering partial Visualforce content in an iframe?

I have a Visualforce page whose controller extension is calling a class to make a web service callout and displaying some data on the page. I'm in the process of optimizing the Apex and page away from ...
0
votes
2answers
32 views

Winter 15 - Validation Rule

I have the following validation rule for a Custom Object: AND(ISPICKVAL( transp__SFT_Trip__r.transp__SFT_Status__c, "Encerrada") , $Profile.Name != "Administrador do sistema") It only let the admin ...
0
votes
2answers
120 views

SOQL returns outdated records in Visualforce PDF

I appear to have a very weird error. I have a business case where I have a button on an opportunity which generates 2 records (related to that opportunity via master-detail). After those records were ...
5
votes
1answer
809 views

Are static variables reset per batch during bulk DML operation? (Executing triggers for field updates)

A while back I had a trigger issue where I needed a trigger operation to execute exclusively on the second update or an update after an insert. So I had some code like this: Trigger Handler Class ...
5
votes
2answers
501 views

Is there a way to know what operation invoked a Trigger in the Trigger code?

I want to execute different logic in an update Trigger, depending on whether the Trigger was invoked by an operation through: a Visualforce page vs. others like standard Page Layout external ...
6
votes
1answer
155 views

Is DML allowed in the current context?

So I can check for isbatch, isfuture, etc... Is there a way to know if the current context allows DML? We've implemented a exception logging object, but if a class is called from a getter or ...