Bulk Apex Triggers | Apex Triggers | Salesforce

preview_player
Показать описание
PLEASE SUBSCRIBE IF YOU LIKE THE VIDEO
Link of the above video :

link of the module :
Рекомендации по теме
Комментарии
Автор

trigger ClosedOpportunityTrigger on Opportunity (after insert, after update) {
List<Task> taskList = new List<Task>();
for(Opportunity opp : [SELECT Id, StageName FROM Opportunity WHERE StageName='Closed Won' AND Id IN : Trigger.New]){
taskList.add(new Task(Subject='Follow Up Test Task', WhatId = opp.Id));
}

if(taskList.size()>0){
insert tasklist;
}
}

WonderStudies
Автор

Error: The trigger closed opportunity trigger is using events in the before context .make sure to use after insert and update
Answer :- replace first line of your code with this " trigger ClosedOpportunityTrigger on Opportunity (after insert, after update)" and rest all is same you can take from pinned comment or code given above.

bullatriratna
Автор

Thank you so much! Your videos have been so useful

teacherana
Автор

Again one problem if is 7th line missing "at 'if'

Deepika_Dupakuntla
Автор

It's working. Just need to copy properly 😃

prajwalsahane
Автор

Error: We created an opportunity and expected it to have an associated task, but it didn’t. Make sure your Apex trigger inserts the task into the database.

Please help to solve this.

malaprolukrishnavamsi
Автор

I am facing this error "we tried to insert 200opportunities but apex trigger exceed DML limits.make sure your code is bulkifield" plz reply me

bhavanavaddepalli
Автор

We can’t find an Apex trigger named ‘ClosedOpportunityTrigger’.

Mine is showing while submitting

malayapati
Автор

It is showing that The Trigger " ClosedOpportunityTigger" is not a legal name . Pls kindly help me sirr....

kayathiniharika
Автор

the trigger closed opportunity trigger is using events in the before context plz help me

surisettishyamala
Автор

Its came like this Failed to enqueue tests an unknown exception occurred pls help me sir

madhu_drums_kadapa
Автор

duplicate value found: <unknown> duplicates value on record with id: <unknown>
how to solve this.

GowribhavaniBandila
Автор

The trigger ClosedOpportunityTrigger is using events in the 'before' context. Make sure to use after insert and after update. tell the answer i can't understand

pottidurga
Автор

Bro the process was consuming too much time After clicked on the CHECK CHALLENGE TO EARN 500 POINTS .

chinnachinnu
Автор

Trigger name, ClosedOpportunityTrigger, exists on different sObject type:Account
Will pls say answer to this prblm

lavanyaathina
Автор

getting this error .
pleasse anyone can help me with it?
We tried to insert Opportunity records as part of the challenge check, but the insert failed. Error: thException: OPP_INSERT | System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Discount_Percentage__c]: [Discount_Percentage__c]

RakeshSingh-zlzs
Автор

help me getting error first insert and update ani chupistuiodi

manju
Автор

Error:
The trigger closed opportunity trigger is using events in the before context .make sure to use after insert and update

thambamounika
Автор

Create a new playground it'll work .

laya
Автор

We can’t find an Apex trigger named ‘ClosedOpportunityTrigger’. help vro

srinugangupam