Oct 05 2020 06:58 AM
I am trying to update/create property in PropertyBag. Its working fine on classic experience (developer site and document center) but its not allowing application to start on modern site collections(root site, communication site and team site) and its not setting property in PropertyBag.
When I try to run application root site collection after installation its throwing this error
Access denied. You do not have permission to perform this action or access this resource.
Please tell me how can I set property in property bag for root site, communication site and team site.
var context = SP.ClientContext.get_current();
var web = LawApp.Repositories.getWeb(context, hostUrl);
var props = web.get_allProperties();
props.set_item("CurrentVersion", 2002);
web.update();
context.executeQueryAsync(success, fail);
Oct 05 2020 05:18 PM
Oct 06 2020 06:03 AM
I don't have any idea about PnPjs. Can you please tell me any other way?Its working fine if I install app on document center or developer site but it says access denied if I install it on root site, communication site or team site.@ArefHalmstrand
Oct 07 2020 12:26 AM
@Asjad_Ali
I solved it by change the value of "CurrentVersion" to string because property bag does not take integer values. You can check this link too.
https://sharepoint.stackexchange.com/questions/171244/setting-propertybag-values-in-sharepoint-onlin...