{"status":403,"body":{"message":"You don't have access to this record. Ask your administrator for help or to request access.","statusCode":403,"errorCode":"INSUFFICIENT_ACCESS"},"headers":{},"ok":false,"statusText":"Unexpected HTTP Status Code: 403","errorType":"fetchResponse"}
I am getting the above console error when trying to use OOTB wire method to fetch the picklist value for a user having standard profile(with all CRUD Permission on field & object). User is accessing this component inside the salesforce.(not on community)
Below code is working properly for System Administration & showing the picklist value.
import { LightningElement,wire,track } from 'lwc';
import { getPicklistValues } from 'lightning/uiObjectInfoApi';
import TYPE_FIELD from '@salesforce/schema/Claim.Status';
export default class PickLst extends LightningElement {
@track fieldsInfo;
value;
@wire(getPicklistValues, {
recordTypeId: '0128c000002wSoiAAE', fieldApiName: TYPE_FIELD })
propertyOrFunction({error, data}){
if(data){
this.fieldsInfo = data.values.map(option => ({
label: option.label,
value: option.value
}));
}
else if (error) {
console.log('Error in Picklistval==>'+JSON.stringify(error));
}
}
handleChange(event) {
this.value = event.detail.value;
}
}
HTML
<template>
<lightning-combobox
name="fieldInfo"
label="field label"
value={value}
placeholder="Select field label"
options={fieldsInfo}
onchange={handleChange} >
</lightning-combobox>
</template>