We are working towards making our application “Lightning Ready”. We have one functionality that we are not able to implement in lightning. I will describe it below. Please advise how we can get similar functionality in lightning.
We have two custom objects, say PARENT and CHILD. CHILD has a lookup to PARENT. We have a visualforce page where when the user clicks on a button in the context of PARENT, we create a new CHILD record, set some of the attributes and open it in edit mode. When opening in edit mode, we also set our own cancelURL page parameter. The idea is that if the user click “Cancel”, we have a mechanism to delete the newly created CHILD record. In lightning, we tried the following options.
- We can create a new CHILD record using sforce.one.createRecord. The problem here is that we cannot prepopulate any fields (other than recordtype) of the newly created CHILD record.
- We can create a new CHILD record using sforce.one.createRecord, populate the required fields, open it in edit mode using sforce.one.editRecord. The problem here is that we do not have a mechanism to delete the newly created CHILD record if the user clicks “Cancel”
The only viable (and not preferred) option is
- Create a custom VF page. This page will take the record type as parameter and render the fields based on a fieldset specific to the record type. The problem here is that we will deviate from defined page layout and also have to maintain separate fieldsets.