You need to sign in to do that
Don't have an account?
jameskCA
Number field with 0 decimal places not an integer?
I have a trigger with some code that references a number field with 18, 0. My method returns an integer and the quantity variable is an integer, however when I try and use the field value I get the following error:
Method does not exist or incorrect signature: dcSystemSize(String, Decimal)
here is all the relevant code:
Is there any way to assign a field to an Integer variable? Or, are they always decimal?
Method does not exist or incorrect signature: dcSystemSize(String, Decimal)
here is all the relevant code:
Map<String, Integer> panelType = new Map<String,Integer>{'Hyundai 255'=>255,'Hyundai 280'=>280,'Trina 290'=>290,'Hyundai 325'=>325,'SW Mono 280'=>280,'Hyundai 290'=>290}; public Integer dcSystemSize(String panel, Integer qty){ Integer panelWattage = panelType.get(panel); return ((panelWattage * qty)/1000); } for(Proposal__c p:Trigger.new){ p.System_Size_kW__c = dcSystemSize(p.Panel_Type__c,p.Panel_Qty__c); }
Is there any way to assign a field to an Integer variable? Or, are they always decimal?
Thanks,
Sumit
All Answers
Thanks,
Sumit