Skip to content
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

Setting Taxonomy field to Allow Fill-in choices fails #778

Closed
1 task done
dgtheninja opened this issue Mar 2, 2022 · 4 comments
Closed
1 task done

Setting Taxonomy field to Allow Fill-in choices fails #778

dgtheninja opened this issue Mar 2, 2022 · 4 comments
Assignees
Labels
area: model 📐 Related to the core SDK models

Comments

@dgtheninja
Copy link
Contributor

Category

  • Bug

Describe the bug

I'm trying to set a taxonomy field to allow fill-in choices for an open term set, but it throws a SharePointRestServiceException with the following detail

HttpResponseCode: 400
Code: Microsoft.SharePoint.Client.InvalidClientQueryException
Message: The property 'Open' does not exist on type 'SP.Field'. Make sure to only use property names that are defined by the type.

Reading the Open property of the field correctly describes the state of the field, but setting the property fails.

Steps to reproduce

    await ctx.Web.LoadAsync(w => w.Fields);

    var taxField = ctx.Web.Fields.AsRequested().Where(f => f.InternalName == "TestTaxField2").FirstOrDefault();

    taxField.Open = true;
    await taxField.UpdateAsync();

Expected behavior

Call should succeed and the taxonomy field is updated to allow fill-in choices

Environment details (development & target environment)

  • SDK version: 1.5.0
  • OS: Windows Server
  • SDK used in: Functions App/Console App
  • Framework: .NET 6/.NET Standard 2.0
  • Browser(s): N/A
  • Tooling: Visual Studio 2022

Thanks for your contribution! Sharing is caring.

@jansenbe jansenbe self-assigned this Mar 7, 2022
@jansenbe jansenbe added the area: model 📐 Related to the core SDK models label Mar 7, 2022
@jansenbe
Copy link
Contributor

jansenbe commented Mar 7, 2022

Hi @dgtheninja ,

I've added support for creating taxonomy fields as open. See this test case for details, docs will follow. https://github.com/pnp/pnpcore/blob/dev/src/sdk/PnP.Core.Test/SharePoint/WebFieldTests.cs#L708-L751

@jansenbe
Copy link
Contributor

jansenbe commented Mar 7, 2022

@dgtheninja : updating the open status for an existing taxonomy field is not yet implemented, feels like that is a less common case and hoping that support for setting "open" on field creation is sufficient? Anyhow, these changes will be part of the next nightly so you can give things a try tomorrow and report back.

@jansenbe
Copy link
Contributor

jansenbe commented Mar 7, 2022

@dgtheninja
Copy link
Contributor Author

@jansenbe, it covers our use case for the moment to only do this on field creation rather than update so very happy with this thanks.

One small comment on the docs, you have the following line
Setting a termset as open only is possible is the respective termset is created as open termset.

should that be
Setting a termset as open only is possible if the respective termset has an open submission policy.

@jansenbe jansenbe closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models
Projects
None yet
Development

No branches or pull requests

2 participants