Comments (4)
Ah, that makes perfect sense, as ever Scott your explanation is on point.
I can also go back to my team now and give them a heads up 👍
I guess you can never be 100% certain that is the case with the scope and naming, only takes a small error when generating one of them and you might get an issue!
Cheers, keep up the awesome work.
from dataverse-gen.
Hi @mrmwink - great to have you on board!
There are two types of choice columns, local definitions and global definitions:
The naming of local enums is (scope)_(choices-logical-name)
, the nameing of global enums is just (choices-logical-name)
The scope part for enums on local choice columns for entities will be the logical name of the entity, whilst for actions, it will be the name of the action. It's important to have this scope disambiguation to ensure that entity choices and action choices don't collide.
Since the accountcategorycode
is a 'local' choice column, the scope is 'account' and the choice-logical-name is account_accountcategorycode
- hence you see the double prefix - account_account_accountcategorycode
For global choices, there is no disambiguation prefix, and the logical name will just be the logical name of the choices - e.g. myprefix_mychoicesname
Since the default is to create global choices ('Sync with global choice' in the screenshot above) - you won't see the disambiguation for your custom choice columns.
Dataverse-gen could perform some optimisation where it looks for name collisions and only prefixes where needed - but I chose to go for consistency instead. If you re-name enums then it will make it difficult to re-generate the metadata and so I recommend against it - and it may seem strange having the scope disambiguation - until you find there is an action that has the same choice logical name but a different set of choices!
I hope this makes sense!
from dataverse-gen.
All that said - if we can guarantee that the choices-logical-name
for actions and entities is always unique, then we perhaps do not need the scope
prefix.
from dataverse-gen.
Great - glad this helped 😊
The collisions tend to happen with 'legacy' actions where the logical names were created literally over a decade ago. The more recent metadata is much more consistent. I'll close this for now - perhaps we can revisit it later.
from dataverse-gen.
Related Issues (16)
- TypeScript type FileType HOT 2
- Linebreaks in attribute description breaks code generation
- Provide include/exclude list of solution prefixes, columns
- Opportunity Close metadata import differs from file name only in casing
- Enums should be sorted by integer value to ensure consistency in generation
- Error:Cannot read properties of undefined (reading 'LogicalName')
- Client ID and Secret auth HOT 3
- Duplicate entries Status reason
- Inconsistency in object names HOT 2
- TokenCache not found while initiating dataverse-gen HOT 5
- After Ejecting templates and customising, re-running dataverse-gen@v2 didn't pick up the new templates HOT 1
- LookupAttributes are missing from the generated FormContext
- Is there a way to turn off the enum generation ? HOT 1
- Generate WebAPI Types
- Timeout issues HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataverse-gen.