New answers tagged

0

See the below code, Below code is the private AddContentTypeToList = () => { let ctEndpointUrl = `${this.props.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.props.list}')/ContentTypes/AddAvailableContentType`; let options: ISPHttpClientOptions = { headers: { 'Accept': 'application/json;odata=nometadata', '...


0

I think you are missing the webpart context in your react component. First of all you need to pass the webpart context from your main webpart file to react component like below: public render(): void { const element: React.ReactElement<any > = React.createElement( HelloWorld, { description: this.properties.description, ...


0

Try my test code,this works well in my environment.Remember to change the contentTypeId. update() { const requestHeaders: Headers = new Headers(); requestHeaders.append('Content-type', 'application/json;odata=verbose'); requestHeaders.append('Accept', 'application/json;odata=verbose'); const body: ISPHttpClientOptions = { body: JSON....


0

Firstly,you could use rest api get URL from field. Official document: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest#working-with-list-items-by-using-rest Secondly,you could use js/jQuery set the iframe src property. $("iframe ").attr("src", "url from field");


0

Well, it turns out that it was indeed caused by deleting the WelcomePageFields XML document from the content type's XmlDocuments property. Somehow that triggers the deleting of the WelcomePageFieldCollection on the template, making the template's WelcomePageFields property null, even though I had re-added a WelcomePageFields XML document to the XmlDocuments ...


Top 50 recent answers are included