Skip to main content
Hello 

I have a apex class and a visual force page which display some data.

In class I have like this:

public string AccountID{get;set;}

AccountID=obj1.CreateAccount();

In visual force page, I have a button which will call the above method.

Now if AccountID is not null then it should display in vf  page as {!AccountID} was successfully created.

If not it should display an error message.

I hope I am clear.

Please let me know how to do this.

Thanks

pooja
1 Antwort
  1. 12. Aug. 2016, 05:53
    Hey Pooja,

    You may try Visualforce's NULLVALUE

    expression function which serves similar needs.

    {!NULLVALUE(AccountID,'Your error message that would be displayed only if AccountID is null')}

    Hope this helps.

     
0/9000