dataverse-gen icon indicating copy to clipboard operation
dataverse-gen copied to clipboard

LookupAttributes are missing from the generated FormContext

Open humanoidcreature opened this issue 2 years ago • 3 comments

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

humanoidcreature avatar Mar 23 '23 15:03 humanoidcreature

Bump for this question! Help us out @scottdurow

strwase avatar Feb 10 '25 09:02 strwase

Bump! @scottdurow

GWawrzeniecki avatar Mar 25 '25 08:03 GWawrzeniecki

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á.

humanoidcreature avatar Mar 25 '25 13:03 humanoidcreature