Skip to main content

New answers tagged

-2 votes

Triggers on contact to update decsiption field of its parent account

Trigger Contacttest on contact (After Update) { if(trigger.isafter && trigger.isupdate){ Set<Id> IDS = new set<Id>(); List<Account> ACC = new List<...
Jagadeesh Pachipala's user avatar
0 votes

Send email in AfterUpdate of new record using the new record for merge fields

The devil's in the details, I'm afraid. Email templates, like everything else, can only see what's already saved to the database. If you check out the Triggers and Order of Operation documentation, ...
sfdcfox's user avatar
  • 497k
0 votes

I am trying to write a trigger on opportunity that will create order and order item on opportunity update event but facing issue

Your problem lies here for (Opportunity opp : [SELECT Id, AccountId, ContractId FROM Opportunity WHERE Id IN :opportunityIds]) { Order newOrder = new Order(); newOrder.AccountId = opp.AccountId; ...
cropredy's user avatar
  • 72.1k
0 votes

Creates the number of contacts which are equal to the numberwhich we will enter in the Number of Locations field on the Account Object

There is a small issue with your code, the Contact object is being instantiated only once outside the inner loop, which means the same Contact reference is being added multiple times to the ...
Tushar Jadav's user avatar
  • 2,203
4 votes

How to find the max amount of an opportunity without using aggregate result in apex trigger?

You're approaching this from the wrong direction. You can actually make this easy enough by using a subquery: public static void updateoppName(Opportunity[] afterSave, Opportunity[] beforeSave) Set&...
sfdcfox's user avatar
  • 497k

Top 50 recent answers are included