Questions tagged [after]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
14 views

Trigger mocking Role-up Summary works for Insert and Update, but not for Delete and Undelete

This trigger to mock Role-up Summary as sum of related field values - works for Insert and Update, but does not work for Delete and Undelete: trigger mockLookup on More_Details_on_the_account__c (...
0 votes
1 answer
40 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
532 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 ...
  • 609
2 votes
2 answers
6k 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
130 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 ? ...
  • 15
0 votes
1 answer
18 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
1k 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
53 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
377 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
87 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 -...
  • 11
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
2k 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: ...
  • 21
0 votes
2 answers
182 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 ...
  • 932
0 votes
1 answer
49 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
868 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
474 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 ...
  • 47
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 : ...
  • 932
4 votes
1 answer
2k 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
400 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 ...
  • 932
2 votes
2 answers
14k 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 ...
  • 753
0 votes
1 answer
186 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 ?
  • 525
7 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 ...
  • 187
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 ...
  • 23
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 ...
  • 1,979