Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <aura:component controller="MyController" implements="flexipage:availableForAllPageTypes,force:hasRecordId" access="global">
  2. <aura:attribute name="recordId" type="Id"/>
  3. ...
  4. <button type="button" onclick="{!c.doRun}">Activate Next</button>
  5. </aura:component>
  6.  
  7. <apex:page standardController="CustomObject__c">
  8. <apex:includeLightning />
  9.  
  10. <div id="mydiv" />
  11.  
  12. <script>
  13. $Lightning.use("myApp", function() {
  14. $Lightning.createComponent("myComponent",
  15. { recordId : "{!CustomObject__c.Id}" },
  16. "mydiv",
  17. function(cmp) {});
  18. });
  19. </script>
  20. </apex:page>
  21.  
  22. ({doRun : function(component, event, helper) {
  23. var action = component.get("c.run");
  24.  
  25. action.setCallback(this, function(response) {
  26. if (component.isValid() && response.getState() === "SUCCESS") {
  27. $A.get("e.force:refreshView").fire();
  28. }
  29. });
  30.  
  31. $A.enqueueAction(action);
  32. }})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement