Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

NishkalankBezawada
Copy link
Contributor

Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1738

What's in this Pull Request?

Problem statement

When a date column is created with an underscore or '_' at the begining, the form is not rendered correctly. For instance, if a column with name '_AccomplishedDate', '1AccomplishedDate' is created, and the list form is not rendered, instead it errors out.

Solution

On investigating the issue, I have created columns as below

Column Name Type Internal Name (Retrieved from Item)
1EFDate DateTime OData__x0031_EFDate
2EFDate DateTime OData__x0032_EFDate
_EFDate3 DateTime OData__EFDate3
12312EDate DateTime OData__x0031_2312EDate
%Test Text OData__x0025_Test
1Test DateTime OData__x0031_Test

Since the FieldInternal names are not matching with the Internal names of the columns, this issue is spotted.
By checking the FieldInternal name as below, and validating, the issue is resolved.

        if (fieldName.startsWith('_x') || fieldName.startsWith('_')) {
          fieldName = `OData_${fieldName}`;
        }

Screenshot

Issue1738

Thanks,
Nishkalank

@AJIXuMuK
Copy link
Collaborator

@NishkalankBezawada - sorry for the long delay. Could you please resolve the conflict?

@NishkalankBezawada
Copy link
Contributor Author

@NishkalankBezawada - sorry for the long delay. Could you please resolve the conflict?

Hello @AJIXuMuK,

I have now resolved the merge conflicts.

Thanks,
Nish

@AJIXuMuK AJIXuMuK merged commit 09f36ab into pnp:dev Feb 13, 2024
@NishkalankBezawada NishkalankBezawada deleted the Issue1738 branch February 13, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants