Search through blog..

Wednesday, February 7, 2018

Error: Field 'xxx' does not exist in D365Ops

Today I encountered a weird error while working with newly created Enums and Tables in Visual Studio 2015 with a Dynamics 365 for Finance and Operations project.

Error message while trying to build my project was: The underlying type 'BKA_Status ' or its base type for table 'BKA_GoalMaster' field 'GoalStatus' does not exist.
The underlying type 'BKA_GoalTypes ' or its base type for table 'BKA_GoalMaster' field 'GoalType' does not exist.</Message>


However, I had the 'BKA_Status' as well as 'BKA_GoalTypes' Enums already available in my project and even the project is Synchronized with the database.




Root cause:
To be honest, I was unable to find the root cause for sure.
However, I imagine the error has something to do with the refresh of metadata because of the kind of solution which helped to resolve the error. 
I have had 'Extends' property filled in with another Enum which was not existing in the Current model (or) the referenced models for a brief period. Later, I had cleared 'Extends' property before performing the build - and still ended up in the above error message.

Solution/Workaround:
I have tried several generic solutions to refresh the cache, like, restarting Visual Studio (in admin mode), rebuilding the solution, clearing the solution, synchronizing project to the database.. however none worked.


The solution which finally worked for me was to select a dummy - yet real enum value under the 'Extends' property and build the solution. Later, I removed the dummy enum value from the property and performed a successful rebuild to attain the state I wanted to be in.

I know this is a very short and unclear post - but I had to record it as I find so few references while searching for a solution for any problem related to D365Ops. It not like searching for an issue in AX anymore, maybe because of the name 'Dynamics 365 for Finance and Operations' :P :P

1 comment:

AJ said...

I had the same error, but only when trying to use some enums on a table map. In the tables themselves, selecting the enum EDT would correctly populate the Enum type field, but in the map it wasn't and then it wouldn't build

I ended up typing in the Enum type ("NoYes") into the Enum type property on the map field and was able to build and use