1

I have a custom field (type- Text(18) (External ID)) say Ext_ID__c on a custom object. We are using custom profile assigned to a group of users. For few users, Ext_ID__c is accessible, however for few users, this Ext_ID__c is not accessible. I checked the accessibility on User ID and its related Ext_ID__c through UserRecordAccess object.

We are using angular to display UI and Salesforce is being used to maintain database. We are using FeedItem to post chats and the Ext_ID__c is somehow related to the posts. When the users (who does not have access to Ext_ID__c) try to post anything, the data does not get saved on FeedItem and we get the error "INVALID_CROSS_REFERENCE_KEY".

Please suggest what could be the possible cause and how can we resolve this.

1

If the field is not visible to user you need to check field level accessibility and field level security. If checked and you are facing problem to access the record then you need to check OWD setting i.e sharing setting from setup and if the object is set to private.

| improve this answer | |
  • Yes the object where Ext_ID__c exists is set to Private. But we cannot make it public. Can we do anything on FeedItem? – Salesforce Learner Jun 22 '17 at 11:08
  • you can write sharing rule with respect to condition and assign ot to public groups (group of user) or Role – sukanya banekar Jun 22 '17 at 12:37
0

Change your controller definition

public class with sharing ClassName{

// Your code

}

to

public class ClassName{

// Your code

}

now you can able to save your records

Thank you Amol Salve Salesforce Developer

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.