You need to sign in to do that
Don't have an account?

Having trouble referencing a user defined enum
Have the following enum in a controller extension:
public enum ApprovalState { NotRequired, Required, Pending }
public ApprovalState CurrentApprovalState { get; set; }
And the following VF snippet:
<apex:commandButton disabled="{!currentApprovalState != ApprovalState.NotRequired}" />
When I attempt to save the VF page, I get "Save error: Unknown property 'Quote__cStandardController.ApprovalState'"
Am I using the wrong syntax to access the enum data type?
I had the same issue. I don't think you can directly reference the enum since the enum itself is not visible to the page and you can't make it a property. I resolved the issue by adding in one more controller property.
public String CurrentApprovalStateForVF { get{return CurrentApprovalState.name();}}
Then change your page to be:
<apex:commandButton disabled="{!currentApprovalStateForVF != 'NotRequired'}" />
All Answers
I had the same issue. I don't think you can directly reference the enum since the enum itself is not visible to the page and you can't make it a property. I resolved the issue by adding in one more controller property.
public String CurrentApprovalStateForVF { get{return CurrentApprovalState.name();}}
Then change your page to be:
<apex:commandButton disabled="{!currentApprovalStateForVF != 'NotRequired'}" />