You need to sign in to do that
Don't have an account?
Problem Triggering Double -> Integer
Hey I'm trying to write a trigger on the one record we have Years for the term. The other one we have months for the term.
What I tried doing is:
double newmonths;
for(Contract c : contractrecords){
newmonths = o.Term_Yrs__c * 12;
c.ContractTerm = newmonths;
Error: Compile Error: Illegal assignment from Double to Integer
How would one accomplish changing the type so that I can do the math and enter it in properly?
Hey thanks I got it by doing o.Term_Yrs__c.intvalue();
Thanks.
All Answers
Try doing
newmonths = Double.valueOf(o.Term_Yrs__c * 12);
Hey thanks I got it by doing o.Term_Yrs__c.intvalue();
Thanks.