You need to sign in to do that
Don't have an account?
Sascha Deinert
Calculation Sum of two values
Hi,
I try to make a calculation of two values. But I didn't get a value.
I want to make a addition of the value Altersstruktur_u18 and Altersstruktur_1822. In the future I need also the same but for division.
Sascha
I try to make a calculation of two values. But I didn't get a value.
I want to make a addition of the value Altersstruktur_u18 and Altersstruktur_1822. In the future I need also the same but for division.
public class testfor3_c { private Id accId {get; set;} public testfor3_c(ApexPages.StandardController stdcontroller) { accId = stdcontroller.getRecord().Id; Altersstruktur_u18 = 0; Altersstruktur_1822 = 0; getEZRen(); } public Integer Altersstruktur_u18 {get; set;} // variable for people < 18 public Integer Altersstruktur_1822 {get; set;} // variable for people >= 18 AND <= 22 public Integer Sum_u18_1822 {get; set;} public void getEZRen() { List<Einzelrisiko__c> EZRList = [SELECT Alter__c, Jahresbeitrag__c, Alter_bei_Vertragsbeginn__c FROM Einzelrisiko__c WHERE Abgangsdatum__c = Null AND Unternehmens_Id_Long__c = :accId]; // create List EZRList with the information Alter__c of all people FOR (Einzelrisiko__c EZR : EZRList) { // Loop thru all people IF(EZR.Alter__c < 18) { Altersstruktur_u18++; } // if Alter__c < 18 variable Altersstruktur_u18 increase IF(EZR.Alter__c >= 18 && EZR.Alter__c <= 22) { Altersstruktur_1822++; } // if Alter__c >= 18 AND <= 22 variable Altersstruktur_1822 increase } Integer Sum_u18_1822 = (Altersstruktur_u18 + Altersstruktur_1822); } }Thanks in advance,
Sascha
Hi, Line with number 28 should be without "Integer":