function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
list<Opportunity> oppList = [Select Id, Name,TotalOpportunityQuantity,ST_NO__c from Opportunity]; decimal total; for(Opportunity o : oppList ){ if(o.TotalOpportunityQuantity !=null && o.ST_NO__c !=null){ total = o.TotalOpportunityQuantity + o.ST_NO__c; Integer intConv = integer.valueOf(total); } else { system.debug('***'); } }
public class SumOfTwoCustomfieldValue { public SumOfTwoCustomfieldValue () { /*Account accObj = new Account (Name='TestSum' , FirstNum__c = 20); insert accObj; */ Account acc = [SELECT FirstNum__c FROM Account WHERE Name Like '%TestSum%' Limit 1]; Integer custom_val = (acc.FirstNum__c).intValue(); System.debug(custom_val); } }
integer f2 = '';
integer f3 = f1+f2;
integer.valueof(f3 );
LIKE THIS
The field created with Number datatype will be decimal value.So you need to first store that fields value to decimal.
Use this logic. Here TotalOpportunityQuantity,ST_NO__c both are the Number fields. If above solution helpful Mark as best Answere to help others.........
Regards,
Harsh P.
Please try the below code and let me know if this works for you. If still need modifications do let me know.
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi