Questions tagged [after]
The after tag has no usage guidance.
24
questions
0
votes
1answer
35 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 ...
1
vote
1answer
371 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
0answers
41 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
1answer
15 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
3answers
113 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
1answer
37 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
1answer
222 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
0answers
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
1answer
66 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
2answers
943 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
1answer
1k 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
2answers
137 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
1answer
42 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
1answer
633 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
1answer
236 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 ...
3
votes
1answer
1k 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
1answer
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
1answer
395 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
2answers
10k 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
1answer
135 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 ?
7
votes
4answers
747 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
2answers
964 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
0answers
23 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
vote
1answer
344 views
Firing trigger on current record [closed]
I was just wondering if there is a way to fire an after insert and after update trigger on the page the user is viewing. The ApexPages.currentPage().getParameters().get('id') is not of much help I ...