Guest User

Untitled

a guest
Oct 23rd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. component.find('caseRecordCreator').saveRecord($A.getCallback(function(saveResult){
  2. if(saveResult.state === 'SUCCESS' || saveResult.state === 'DRAFT'){
  3. var savedCaseEvent = component.getEvent('caseSaved');
  4. var caseRecord = component.get('v.caseRecordTemplate');
  5. savedCaseEvent.setParams({record : caseRecord, success : true});
  6. savedCaseEvent.fire();
  7. }else{
  8. //TODO: Error handle other states
  9. console.log('case error: ' + JSON.stringify(saveResult.error));
  10. }
  11. }));
  12.  
  13. This page has an error. You might just need to refresh it.
  14. Error in $A.getCallback() [Cannot read property 'setParams' of null]
  15. Callback failed: serviceComponent://ui.force.components.controllers.recordGlobalValueProvider.RecordGvpController/ACTION$saveRecord Failing descriptor: {c:CaseEditorForm}
  16.  
  17. var savedCaseEvent = component.getEvent('caseSaved');
  18. var caseRecord = component.get('v.caseRecordTemplate');
  19. component.find('caseRecordCreator').saveRecord($A.getCallback(function(saveResult){
  20. if(saveResult.state === 'SUCCESS' || saveResult.state === 'DRAFT'){
  21. savedCaseEvent.setParams({record : caseRecord, success : true});
  22. savedCaseEvent.fire();
  23. }else{
  24. //TODO: Error handle other states
  25. console.log('case error: ' + JSON.stringify(saveResult.error));
  26. }
  27. }));
Add Comment
Please, Sign In to add comment