Skip to content

Error on rendering DynamicForm when having a Date Field with internal name starting with underscore ("_") #1738

Closed
@Lewin8687

Description

@Lewin8687

Category

[ ] Enhancement

[X] Bug

[ ] Question

Version: [3.15.0]

Expected / Desired Behavior

The form should be rendered successfully.

Observed Behavior

The form dispears and errors show in the console.
image

Steps to Reproduce

  1. Create an extension using DynamicForm
  2. Add OOTB "End Date" or any date field named starting with a number (for example, "1Date") to a content type
  3. Add the content type to a document library
  4. Create a document out of the content type
  5. Attach the custom form to the list content type
  6. Add a date value to the new document from Details Pane
  7. Open custom form
  8. Issue: errors show up in console, the form shows and disappears.

Investigation

The reason could be the line to get the date value from the list item.
image

The key of the date field value in list item is not the same as field internal name. For example, for OOTB date field "End Date", internal name is "EndDate", but in list item, its saved as "OData__EndDate". Same to other fields which internal name starts with underscore "". SharePoint will prefix it with "OData_" to make DynamicForm unable to get the value.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions