You need to sign in to do that
Don't have an account?
Brian11
Server side Controller not working when using the following implement lightning:recordHomeTemplate
Any functions on the client side controller work without a problem but If i have to make a call to an apex server The function doesnt exists.
Is this a behavior that is not allowed?
Is this a behavior that is not allowed?
public with sharing class ContactRecordHomeController { @AuraEnabled public static String updateStatus() { User user = [Select sidebar_Status__c From User Where Id = :UserInfo.getUserId()]; user.sidebar_Status__c = !user.sidebar_Status__c; update user; return 'user'; } }
I trust you are doing very well.
According to the information provided by you, it seems that you are using the same JavaScript method name as the Apex controller method. According to this post (https://salesforce.stackexchange.com/questions/129261/enqueued-action-not-executed-in-lightning-component), "A javascript method name in a component controller can never be the same name in an apex lightning controller".
Just need to change the name of your javascript method to be different from the apex method.
If the problem still persists, please share your complete code.
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 future.
Thanks and Regards,
Khan Anas
I should have shared the entire code. but the client side controller names are different. I cant find any documentation on (lightning:recordHomeTemplate) limplents. I'm not sure if thats just not allowed when using the implements
Component:
Client Side Controller:
Apex Controller:
did you find any solution for this?
Thanks in advance