Skip to content

Conversation

@sdransfeld
Copy link

When we query MS Dynamics with odata, we need the enum name in the escaped value. Now we get:
https://mg-prod.operations.dynamics.com/data/Projects?$filter=ProjectStage eq ProjStatus.InProcess
but we need
https://mg-prod.operations.dynamics.com/data/Projects?$filter=ProjectStage eq Microsoft.Dynamics.DataEntities.ProjStatus'InProcess'

So in addition to this patch, when we reflect we also need to get the fully qualified name into the enum. Not:
Enum("ProjStatus", ...)
but:
Enum("Microsoft.Dynamics.DataEntities.ProjStatus", ...)

And I guess that
ProjectStage: str = EnumTypeProperty("ProjectStage", enum_class=ProjStatus)
should be
ProjectStage: Enum = EnumTypeProperty("ProjectStage", enum_class=ProjStatus)
?

If you don't have access to a system with enums, I can test changes if you need any.

@eblis
Copy link
Owner

eblis commented Dec 7, 2024

I don't have access to a system with enums unfortunately.

@sdransfeld sdransfeld force-pushed the enum_reflect branch 2 times, most recently from 8cf9ba3 to fd16ce9 Compare April 28, 2025 08:18
@sdransfeld
Copy link
Author

This works for me with Microsoft Dynamics. Dynamics is also slow, so I need a longer timeout.

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