JSOM unable to get Terms from TermStore for user with Read Access

Copper Contributor

I am using JSOM to fetch terms from TermStore the solution been working fine. Since yesterday for standard users the JSOM is unable to get terms. However if I make everyone TermStore admin the Javascript call works. Below is javascript code and the api response:

 

JSOM:

                var context = SP.ClientContext.get_current();
                var taxonomySession = SP.Taxonomy.TaxonomySession.getTaxonomySession(context);
                var termStore = taxonomySession.getDefaultSiteCollectionTermStore();
                var termSets = termStore.getTermSetsByName("Global Navigation", 1033);
                var termSet = termSets.getByName("Global Navigation");
                var terms = termSet.getAllTerms();
                context.load(terms);
                context.executeQueryAsync(Function.createDelegate(this, function (sender, args) {

 

Response from ProcessQuery call:

[
{
"SchemaVersion":"15.0.0.0","LibraryVersion":"16.0.7709.1205","ErrorInfo":{
"ErrorMessage":"Specified argument was out of the range of valid values.\r\nParameter name: index","ErrorValue":null,"TraceCorrelationId":"55086a9e-f08a-5000-d331-8415c61f9ebf","ErrorCode":-2146233086,"ErrorTypeName":"System.ArgumentOutOfRangeException"
},"TraceCorrelationId":"55086a9e-f08a-5000-d331-8415c61f9ebf"
}
]

 

Any help would be appreciated.

 

3 Replies

Which version of Sharepoint is this? Can you track error log by correlation id?

We are working with SharePoint Online so don't have access to logs. Apparently Microsoft didn't upgrades and since then it has stopped working. Raised a service request but that was assigned to First Line support and they couldn't help.

it is an permission issue. Same error we got while accessing terms form store. We gave read access to the users.
In our case we add All users Except external in our Read group and it start working.
hope it may help you give a try.