You need to sign in to do that
Don't have an account?
Jim Montgomery
Trying to assign a value for SOQL query as variable
Trying to assign extended_maintenance_months__c as the variable months in the definition of addMonths.
trigger SoftwareAnnualEndDates on Apttus_Proposal__Proposal__c (After update) {
List<apttus_proposal__proposal_line_item__c> lstToUpdate = new List<apttus_proposal__proposal_line_item__c>();
for(apttus_proposal__proposal_line_item__c obj :[select maintenance_end_date__c, proposal_end_date__c,extended_maintenance_months__c from apttus_proposal__proposal_line_item__c where extended_maintenance_months__c >0 and apttus_proposal__proposal__c != null and apttus_proposal__proposal__c in : trigger.new])
{
obj.maintenance_end_date__c = proposal_end_date__c.addMonths(Months);
lstToUpdate.add(obj);
}
if(!lstToUpdate.isEmpty())
update lstToUpdate;
}
trigger SoftwareAnnualEndDates on Apttus_Proposal__Proposal__c (After update) {
List<apttus_proposal__proposal_line_item__c> lstToUpdate = new List<apttus_proposal__proposal_line_item__c>();
for(apttus_proposal__proposal_line_item__c obj :[select maintenance_end_date__c, proposal_end_date__c,extended_maintenance_months__c from apttus_proposal__proposal_line_item__c where extended_maintenance_months__c >0 and apttus_proposal__proposal__c != null and apttus_proposal__proposal__c in : trigger.new])
{
obj.maintenance_end_date__c = proposal_end_date__c.addMonths(Months);
lstToUpdate.add(obj);
}
if(!lstToUpdate.isEmpty())
update lstToUpdate;
}
use below updated code.
Hope this will help you
Thanks
karthik