dataverse-gen
dataverse-gen copied to clipboard
LookupAttributes are missing from the generated FormContext
My .dataverse-gen.json has the following settings:
"entities": [
"account",
"contact",
"email",
"incident"
],
"actions": [],
"functions": [],
"output": {
"outputRoot": "./src/dataverse-gen"
},
"generateFormContext": true,
"generateEntityTypes": true
}
Versions I use:
"dataverse-gen": "^2.0.15",
"dataverse-ify": "^2.0.7",
"dataverse-auth": "^2.0.7"
The files are generated, I love it, the only issue is that the LookupAttributes and LookupControls are not generated for the formContext.
Do I miss something here or it's not working out of the box?
@scottdurow
Bump for this question! Help us out @scottdurow
Bump! @scottdurow
I had a workaround for that by the way. You need to use custom templates and modify the entity.ejs file.
To use the custom templates there's this small documentation on the readme.md for this project, but to summarize it you need to use the npx dataverse-gen eject command.
After you have the template files, go into the entity.ejs and edit the condition in line 19 for generating the propeties from this
<%locals.Properties && locals.Properties.forEach(function(property){ if(!property.AttributeOf && property.SourceType === 0 && property.TypescriptType.name !== 'Guid' && property.TypescriptType.definitelyTypedAttributeType) { _%>
to this
<%locals.Properties && locals.Properties.forEach(function(property){ if(!property.AttributeOf && (property.SourceType === 0 || property.Type == 'LookupType' || property.Type == 'MemoType') && property.TypescriptType.name !== 'Guid' && property.TypescriptType.definitelyTypedAttributeType) { _%>
Voilá.