Skip to content

Conversation

@babltiga
Copy link
Contributor

@babltiga babltiga commented Nov 2, 2017

Currently, when generating queries with Enum properties the code uses Enum.toString() as a value which is used in the Service query as a result Service Endpoint returns error Services V3 Query Value for XXX.XXX must be a valid enumeration value. When using Enums from ipp-v3-java-data the Enum.value() method should be used to get the correct query value.

Example

Account accountProxy = GenerateQuery.createQueryEntity(Account.class);
String query = select($(accountProxy)).where($(accountProxy.getName()).eq("Some Name")).where($(accountProxy.getAccountType()).eq(AccountTypeEnum.BANK)).generate();
QueryResult queryResult = service.executeQuery(query);

Ends up with ERROR CODE:10000, ERROR MESSAGE:An application error has occurred while processing your request, ERROR DETAIL:System Failure Error: Services V3 Query Value for Account.AccountType must be a valid enumeration value

@diana-derose diana-derose merged commit cbabd74 into intuit:develop Nov 3, 2017
@diana-derose
Copy link
Collaborator

Thanks for the PR, I have included this in v3.0.2.

@babltiga babltiga deleted the enum-queries branch November 3, 2017 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants