function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ashish2802Ashish2802 

User.ContactId field causing compile error in lightning component

Hi,
I have a lightning component which has started giving below compile error for User.ContactId Field referenced in the apex controller.

Failed to save VV_Circles.cmp : Invalid definition for null: VV_BookingsController: SELECT ID, ContactId FROM User LIMIT 1 ^ ERROR at Row:1:Column:12 No such column 'ContactId' 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.

The lightning component was working fine till Spring 19 release was rolled out in the Development sandbox. 

This issue has also impacted the Community Builder Page where this component is being used and causing internal server error in Community Builder.
An internal server error has occurred Error ID: 1138818950-215153 (403527751)

Please provide your suggestions for this issue.
Best Answer chosen by Ashish2802
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ashish,

Greetings to you!

I tried to research your problem and found that this is a known issue. Keep watching this issue until get fixed.

https://success.salesforce.com/issues_view?id=a1p3A000001SGubQAG&title=field-integrity-exception-when-saving-a-lightning-component-in-developer-console-which-references-user-fields

Workaround suggested by Salesforce:

Use Metadata API or VS Code and SFDX to deploy changes to your lightning components.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas

All Answers

Pavit SiddhuPavit Siddhu
Only Users who are enabled for Customer Portal User or Partner User will have a contact lookup on the user detail page. 
https://developer.salesforce.com/forums/?id=906F00000008yQ4IAI
Khan AnasKhan Anas (Salesforce Developers) 
Hi Ashish,

Greetings to you!

I tried to research your problem and found that this is a known issue. Keep watching this issue until get fixed.

https://success.salesforce.com/issues_view?id=a1p3A000001SGubQAG&title=field-integrity-exception-when-saving-a-lightning-component-in-developer-console-which-references-user-fields

Workaround suggested by Salesforce:

Use Metadata API or VS Code and SFDX to deploy changes to your lightning components.

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
This was selected as the best answer