• Peter Kamp1
  • NEWBIE
  • -1 Points
  • Member since 2015
  • CEO

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am unable to call apex class server side method from Javascript controller code for a lightning component. I have tried various options like changing return type for the apex server side method from Map to String etc but it throws error
I have even tried copying sample code given for sample expense app available on web but still SetCallBack doesnt work and error is thrown when Lightning Component is getting loaded inside Lightning app. Please let me know if anybody has faced this issue. Also let me know if we can use SOQL query to directly query custom object inside Javascript code of lightning. I have placed a button on my Salesforce.com desktop edition Case Page Layout which invokes Salesforce.com Lightning APP.
On Click of the button I want to invoke a method in apex class which makes REST API calls to some external system and updates some custom fields in Salesforce.com. When the REST API call is finished and apex code is also finished updating fields in Salesforce.com I want to receive a response from apex server side and then based on that response I want to issue a SOQL query on Custom Object of Salesforce.com from Client Side Javascript controller code of the lightning component which is used inside the lightning app. Please let me know the best way to achieve this.
Is there any way other that using Action.setCallBack to communicate between client and server

 
  • August 17, 2015
  • Like
  • 0

Hello,

We can add a datasource onto the attribute in the design resource, like this:
<design:attribute name="Name" datasource="value1,value2,value3" />

How can I use a dynamic datasource instead of hardcoding the values.

Thanks,

Devendra