We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [after]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
3answers
70 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
28 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
102 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
27 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
57 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
471 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.
1
vote
1answer
911 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
96 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
37 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
449 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
130 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
690 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
1k 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
358 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
7k 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
110 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
451 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
462 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
284 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 ...