You need to sign in to do that
Don't have an account?
Wik
Trigger Suggestion
Hi,
There are 2 objects named A and B. These two object are connected through a Junction Object C.
A is the master of the Master Detail relation ship between A and C.
B and C are connected using a lookup relationship.
If i need to delete a record of object B based on certain condition of object A.
Then on which object do i need to write the trigger.
If there are examples for this sort of an application. Please suggest.
Any insight is appreciated.
Thank you.
please refer this link will help you
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008oyrIAA
https://developer.salesforce.com/forums/ForumsMain?id=906F00000008n49IAA
Thank You
i wrote something as below:
trigger cascadeJunctionDelete on Opportunity_Equipment__c (after update) {
List<Opportunity> oppList = new List<Opportunity>();
List<Equipment__c> eqList = new List<Equipment__c>();
for(Opportunity_Equipment__c ed : Trigger.old) {
if((Opportunity.StageName == 'Closed Lost' || Opportunity.StageName == 'Closed-Abandoned') && ( Equipment__c.Status__c == 'Pending Sales') ) {
oppList.add(new Opportunity(id=ed.Opportunity__c));
eqList.add(new Equipment__c(id=ed.Equipment__c)); }
}
if(eqList.size() > 0) {
delete eqList;
}
}
But am geeting an error while saving this :
Error: Compile Error: Comparison arguments must be compatible types: Schema.SObjectField, String at line 10 column 5
i.e. at the highlighted line