You need to sign in to do that
Don't have an account?
bingi crm 7
I am write a trigger custom obj and opportunity (relationship) .
I am write a trigger custom obj and opportunity (relationship) .
i create one custom obj(Top_X_Designation__c) in that
1) type(picklist) Contract Flow DownHandoff
2) Attachment (Check box)
Create one field Handoff Attached with picklist type with values are True, False on Opportunity Object.
Logic :- If Type (Top X Designation) = "Contract Flow DownHandoff", and "Document Attached" = True then "Handoff Attached" = True, otherwise false.
trigger updaterecord on Top_X_Designation__c (after insert, after update){
List<ID> OppIds = New List<ID>();
for(Top_X_Designation__c o : Trigger.new){
if(o.Document_Attached__c == True && o.Type__c != 'Contract Flow DownHandoff'){
OppIds.add(o.Type__c );
}
}
List<Opportunity> oppList = [SELECT id, Handoff_Attached__c,Relationship__c FROM Opportunity WHERE id in :OppIds];
for(integer i = 0 ; i < oppList.size(); i++){
oppList[i].Handoff_Attached__c = 'True' ;
}
update oppList;
}
i create one custom obj(Top_X_Designation__c) in that
1) type(picklist) Contract Flow DownHandoff
2) Attachment (Check box)
Create one field Handoff Attached with picklist type with values are True, False on Opportunity Object.
Logic :- If Type (Top X Designation) = "Contract Flow DownHandoff", and "Document Attached" = True then "Handoff Attached" = True, otherwise false.
trigger updaterecord on Top_X_Designation__c (after insert, after update){
List<ID> OppIds = New List<ID>();
for(Top_X_Designation__c o : Trigger.new){
if(o.Document_Attached__c == True && o.Type__c != 'Contract Flow DownHandoff'){
OppIds.add(o.Type__c );
}
}
List<Opportunity> oppList = [SELECT id, Handoff_Attached__c,Relationship__c FROM Opportunity WHERE id in :OppIds];
for(integer i = 0 ; i < oppList.size(); i++){
oppList[i].Handoff_Attached__c = 'True' ;
}
update oppList;
}
Use
Thanks,
Nitin Sharma