Guest User

Untitled

a guest
Mar 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <aura:component implements="force:appHostable">
  2. <aura:attribute name="recordId" type="String" />
  3. <lightning:card title="Create Reservation">
  4. <lightning:recordEditForm
  5. onsuccess="{!c.handleSuccess}"
  6. objectApiName="Campsite_Reservation__c">
  7. <!-- the messages component is for error messages -->
  8. <lightning:messages />
  9. <lightning:inputField fieldName="Campsite__c" value="a041o00000ZWoFbAAL"/>
  10. <lightning:inputField fieldName="Reference__c"/>
  11. <div class="slds-m-top_medium">
  12. <lightning:button variant="brand" type="submit" name="save" label="Save" />
  13. </div>
  14. </lightning:recordEditForm>
  15. </lightning:card>
  16.  
  17. ({
  18.  
  19. handleSuccess: function(cmp, event, helper) {
  20. var params = event.getParams();
  21. cmp.set('v.recordId', params.response.id);
  22. }
Add Comment
Please, Sign In to add comment