Field Integrity Exception when saving a Lightning Component in Developer Console which references User Fields
Apex , Developer Console , Lightning , Summer 19
Last updated 2022-02-10 ·Reference W-6043853 ·Reported By 135 users
Summary
In your Summer '19 Sandbox in Developer Console: if you try to make a change and save a Lightning component which queries the user object and it's fields you will sometimes receive a Field Integrity Exception Error relating to one of the fields being queried.
Eg:
FIELD_INTEGRITY_EXCEPTION
Failed to save TestUserrole.cmp: Invalid definition for null:TestUserRole: No such relation 'UserRole' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.: Source
OR:
FIELD_INTEGRITY_EXCEPTION
Failed to save OneTrainingCmp.cmp: Invalid definition for null:classControllerForWWCustomer: Select Id, LanguageLocaleKey FROM User where ^ ERROR at Row:1:Column:12 No such column 'LanguageLocaleKey' on entity 'User'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.: Source
OR so on
Repro
Create a simple component and Apex controller in your org (deploy it to the org with Metadata API or from VS Code with SFDX
<aura:component controller="TestUserRole">
</aura:component>
public class TestUserRole {
@AuraEnabled
public static String getListAccountStage() {
list<User> listUser = [SELECT UserRole.name FROM User Where Id =: UserInfo.getUserId()];
return 'hello';
}
}
Then, make a change to the component(even just add whitespace) in the Developer Console and try to save
You will have a Field Integrity Exception Error and won't be able to save
Workaround
Use Metadata Api or VS Code and SFDX to deploy changes to your lightning components
Reported By (135)






































Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.