Hi,
I have a strange behaviour doing a web api call to get lookup value of an entity.
It works with a system admin, but doesn't return lookup value for a user with a security role with Organization access to the entities it is querying.
As you see I've built 2 calls, to test if second call work, despite first one works for the sys admin user,
I've make sure user has Organization permissions to Resource and bank holiday jurisdiction, but it always return null.
Is there anything else related to permission I should check?
Xrm.WebApi.retrieveMultipleRecords("bookableresource", "?$select=name,_new_bankholidayjurisdiction_value&$expand=new_BankHolidayJurisdiction($select=new_name)&$filter=_userid_value eq " + userID).then(
function success(resultQuery)
{
if(resultQuery.entities.length == 0)
{
return;
}
else
{
var resultResource = resultQuery.entities[0].bookableresourceid;
Xrm.WebApi.retrieveRecord("bookableresource", resultResource, "?$select=_new_bankholidayjurisdiction_value").then(
function success(resultFP) {
var payee = resultFP._new_bankholidayjurisdiction_value
},
function (error) {
console.log(error.message);
// handle error conditions
}
);
system Admin call
Thanks so much Guido! I couldn't understand why it didn't work!
the field has a key icon beside the name, it means it is protected by Column Security
you need to create a security profile (in addition to the security role the user has already) with the read permission on that field and assign it to the user so it can read the value (by the form or by web api)
Hi Guido, thanks for the reply
Yes it has a value..
you are running two different query, due to this condition:
&$filter=_userid_value eq " + userID
are you sure that the bookable resource record you are checking (the one with the ID starting with db7... has the lookup new_bankholidayjurisdiction filled with a value?
because the other screenshot (the one you run with sysadmin) it shows a different record (starting with ID 7f35) due to how the first query is structured.