Tuesday 26 April 2016

AuraEnabled methods must be named with a prefix 'get' in Salesforce

You may received an error as AuraEnabled methods must be named with a prefix 'get'. If yes, check out the below points to resolve the issue,

1. Methods must be static and marked public or global. Non-static methods are not supported.


  1. @AuraEnabled
  2. public static string buildName()
  3. {
  4.    return 'Hi';
  5. }

2. If you are declaring method without any return type then the method name should prefix with  'get'.

  1. @AuraEnabled
  2. public static void getValidName()
  3. {
  4. // Logic here.
  5. }

No comments:

Post a Comment

Activities: Assign Tasks to a Queue Salesforce Lightning

Salesforce announced to assign Tasks to a Queue beginning from Spring'20 release. How does it work? In Setup, enter Queues in th...