Sunday, 17 March 2019

spfx Add Content type to List/Library using pnp


private AddSiteToContentTypeToList():void
{
//id of content type
pnp.sp.web.lists.getByTitle("Test").contentTypes
.add("0x01002189FE08454A7F4ABA16A6F0D0E030FE","CustomContentType")
.then(function(response)
{
console.log("Content Type added to List!");
}).catch(function(exception)
{
alert("Something went wrong :"+exception);
});
}

No comments:

Post a Comment