How to set enum in java action

1
When trying to set an attribute with a enum value in a java action like this: __Submission.setValue(this.getContext(), "Application_Category", ApplicationCategory.Maintenance); I get an error message that basically displays this message: Caused by: java.lang.Exception: The given value 'Maintenance' with type 'class submissiontracker.proxies.ApplicationCategory' is not of the same type as the member corresponding with the given member name 'Application_Category'
asked
1 answers
3

Using proxies;

Submission s = Submission.initialize(this.getContext(), __Submission);
s.setApplication_Category(ApplicationCategory.Maintenance);

or otherwise use toString:

__Submission.setValue(this.getContext(), "Application_Category", ApplicationCategory.Maintenance.toString())
answered