Questions tagged [after]
The after tag has no usage guidance.
26
questions
-1
votes
1
answer
46
views
Trigger to calculate Average date of closed opportunity if its closed won?
public class AverageDateOpportunityHandler {
public static void afterUpdateMethod(List<Opportunity> oppList) {
Integer totalDays = 0;
for (Opportunity opp : oppList) {
...
1
vote
1
answer
346
views
how can I assign metadata through a flow? // after save record triggered flow
Hi how are you? I have a problem, I am migrating a process builder to flow in the Case object. The problem arises with a decision in which it enters if the following conditions are met:
AND(
ISCHANGED(...
0
votes
1
answer
45
views
Salesforce flow: prior values in after update [closed]
I would like to check if the field value is Chnaged or not? like we do in Apex Triggers.
I am able to see isChanged function in 'Before Update/Insert' scenario, but as formula fields are not available ...
0
votes
1
answer
896
views
Update the parent case when the child case is closed only on certain recortypes
I am trying to update the parent case status when the child case is closed and thhis should happen only on certain record types. Also I need to bring in the last case comment from the child case that ...
2
votes
2
answers
8k
views
Can't call a Subflow from a record triggered flow?
I have created a sub flow with inputs and outputs but the subflow icon is not available in the Elements menu. The flow fires after a record is saved, so my understanding is it should be able to fire ...
0
votes
0
answers
341
views
Trigger Field Update for existing records
I wrote a trigger to update the field B with a field A value when we create a record, now I want that field B to update everytime I edit the record. would trigger update the existing record fields ? ...
0
votes
1
answer
20
views
Problem with IN Clause in soql
Hi everyone I'm having a problem with a query over campaignmember object, Im trying to use In clause to filter by id , but it retrieves nothing, crazy thing is that the list actually has an id, and it ...
0
votes
3
answers
2k
views
Update map.values() doesn't work
I don't know why my object's field from map doesn't change. Can you help me please?
public void changeCommentAfterUpdate(List<OppDesc__c> newOppDesc){
Map<Id, Tool__c> mapToConnect = ...
0
votes
1
answer
68
views
I would like a trigger that is going to update the Description field on the account with the last notes made on the check-in object
For example, on the account, there is a related list called check-ins. Every time a check-in is created related to an account, I want to capture details of check-ins and need it appended to details to ...
0
votes
1
answer
439
views
After update trigger fires twice, first with no updated info, second with info
I'm writing a trigger that chops up a long-text field on an event activity record and puts it into the appropriate fields on the related contact's record. The problem is, the code seems to be firing ...
0
votes
0
answers
28
views
Updating Child records from upadting a field in child record
I have created four contacts for an account.
I want to update child records of an account.If I update lastname in first record of my contacts to 'AAAA' then the lastname for the remaining three ...
-1
votes
1
answer
92
views
How to update parent object field with the difference of the child object field value
I have a trigger on child object which updates the parent Obj field 'Qtyremaining' when there is a value in the child obj field 'Invoice_Quantity__c'. So the value of Parent
"Qtyremaining = quantity -...
0
votes
2
answers
2k
views
Why After trigger cannot update same record? [duplicate]
I know after trigger cannot update the same record. But i would like to know why. I know the record is committed into the database. So the record is read only. But why the record is read only.
2
votes
1
answer
3k
views
Before Update Vs after Update Trigger
I have a scenario where i want to update the lead record's rating field when the status changes to status == 'Closed - Not Converted'. And i wrote after update trigger for this. Below is the code:
...
0
votes
2
answers
197
views
can we avoid 2nd for loop
I have written this trigger in this can we avoid the second for loop using map.
Trigger Sum on Contact(after insert, after update, after delete, after undelete)
{
Set<Id> accountIdSet = new ...
0
votes
1
answer
60
views
Read-only exception in trigger
Execution of AfterInsert caused by: System.FinalException: Record is read-only
trigger Contact_details_on_task on Task (before insert) {
list<task> t=[select whoid,description from task];
...
0
votes
1
answer
956
views
after update SELF_REFERENCE_FROM_TRIGGER recursive save [duplicate]
I'm new to salesforce (apex - trigger) development and I'm currently reading through the manual and other threads on here on how to do this stuff, but I wanted to put this out here in case it was a ...
-3
votes
1
answer
533
views
How to avoid soql inside for loop in apex class?
whenever a user is created I am adding that user to chatter group based on region and also based on region field if user region is changed from Asia to Europe then I am trying to remove user from Asia ...
4
votes
1
answer
2k
views
Trigger to send Email to contacts
I am writing a trigger to send email to all contacts of an account when it is edited.
trigger SendEmailToContacts on Account (after update)
{
try{
String addresses;
for(Account acc : ...
4
votes
1
answer
3k
views
Question regarding "RunOnce" Booleans on AfterUpdate methods in a Salesforce Transaction
I recently encountered a business logic bug in our org that was accidentally deducting a customer 2x for completing an event that only actually occurred once. Using dev console I was able to determine ...
0
votes
1
answer
406
views
Trigger to make Same changes in child object
I have a requirement in which when I create a record in parent object(subject__c) that same record should be created in child(sub_Subject__c).Also when subject__c is updated, all the changes that have ...
2
votes
2
answers
17k
views
trigger event using after insert
I Created an object called Percentile with 10 fields and created one more field called Percentage. If I enter a value for one field and if i save it, Then the Percentage field value should be updated ...
0
votes
1
answer
195
views
Is there an Alternative of 'After Delete' Trigger?
I want to perform an action (say some calculations)after a delete operation. Can this be achieved in any way other than an after delete trigger ?
8
votes
4
answers
1k
views
Is there any way to use only one SOQL for both before and after trigger on the same object?
I need to query Queue Ids in the before and after triggers on the same object, using the same SOQL statements. As hard coding them is not a good practice, I want to check if there is any way to avoid ...
2
votes
2
answers
2k
views
SObject row was retrieved via SOQL without querying the requested field: Account.Wholesaler__r:
I have a custom object lookup Wholesaler__c in Account Object. my requirement is to create a trigger, which would create a custom object record Billing__c when an Opportunity is created. Billing__c ...
0
votes
0
answers
25
views
Trigger activation control for actual afterUpdate
Here's a problem I'm wondering about how to solve, and have an elegant solution to for my future reference. I have a callout to an external web service in my afterUpdate Opportunity trigger that ...