You need to sign in to do that
Don't have an account?
farah sherif
guys i need help with the trigger below please
this is supposed to be the function of the trigger:
When Cancellation_Received_Date__c is populated on an AssetRecord,
Copy Actual_Cancellation_Date__c from the Asset Object
To Actual_Cancellation_Date__c on the OpportunityLineItem Object
Use Opportunity_Product_ID__c on the Asset Object to determine which Opportunityline item to update
I wrote the below trigger but I can't write the part where is copies the actual cancellation
trigger CopyDateTrigger on Asset (after update, after delete) {
map<id,date> toupdate = new map<id,date>();
for(Asset a:trigger.new){
if(a.Actual_Cancellation_Date__c != null){
toupdate.put(a.Opportunity_Product_ID__c,a.Actual_Cancellation_Date__c);
}
}
if(!toupdate.isEmpty() ){
for(Id i:toupdate.keySet()){
}
}
}
When Cancellation_Received_Date__c is populated on an AssetRecord,
Copy Actual_Cancellation_Date__c from the Asset Object
To Actual_Cancellation_Date__c on the OpportunityLineItem Object
Use Opportunity_Product_ID__c on the Asset Object to determine which Opportunityline item to update
I wrote the below trigger but I can't write the part where is copies the actual cancellation
trigger CopyDateTrigger on Asset (after update, after delete) {
map<id,date> toupdate = new map<id,date>();
for(Asset a:trigger.new){
if(a.Actual_Cancellation_Date__c != null){
toupdate.put(a.Opportunity_Product_ID__c,a.Actual_Cancellation_Date__c);
}
}
if(!toupdate.isEmpty() ){
for(Id i:toupdate.keySet()){
}
}
}
Best Answer chosen by farah sherif
Raj Vakati
Try this