Fix Issue 1392 - New items are always created with the default content type if the list has multiple content types #1626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's in this Pull Request?
Fix for issue #1392
The site has a list called List1. List1 has multiple content types, CT1, CT2 and CT3, the default content type is CT1. All content types have different fields added to them. When the user opens the new form, and creates a new item, the new item's CT matches the one the user chooses on the sharepoint interface.
Expected behaviour
When
contentTypeId
is passed as property to Dynamic Form, New item should be created based oncontentTypeId
which is passed.Solution
Èxtra check is done at method
onSubmitClick
while creating a new item, as belowNew Item with CT scenario
Edit item scenario
New item without CT Scenario
Thanks,
Nishkalank