Skip to main content
reddy naveen 님이 #Trailhead Challenges에 질문했습니다
public class Employee1 {

 

    public integer age{set;get;}

 

    public Employee1(){        

 

    }

 

    public pagereference save(){

 

        if(  age!=null && age='' ){

 

             return new pagereference('/apex/IF_ELSE_IF');         

 

        }else{

 

            apexpages.Message msg= new apexpages.Message(apexpages.Severity.WARNING,'please enter age');

 

             apexpages.addMessage(msg);

 

            return null;

 

        }

 

        }  

 

    }

 

 
답변 1개
  1. 2018년 11월 2일 오전 8:17
    Remove  age='' from the If condition because it's data type is Integer and integer can never be blank but can be null value 

     

    You can use the below condition

     

    if(  age!=null && age==0 ){
0/9000