0

I have a custom object that has a lookup relationship with opportunity, on the opportunity's related list for this object I have added the New button and overriden it with a lightning component, I need to access the opportunity object. How can I do this ? Right now my init method fires the createRecord event, but I need to perform some custom validation before this.

doInit : function(component, event, helper) {
    var createWA = $A.get('e.force:createRecord');
    var id = component.get("v.recordId");
    console.log('rec id: '+id);
    if(createWA){
        console.log('create available');
        createWA.setParams({
            "entityApiName":"Waste_Assessment__c",
            "recordTypeId":"012E0000000DFeJIAW"
        });
        createWA.fire();
    }else{
        console.log('Create Record NA');
    }

https://developer.salesforce.com/forums/?id=9060G000000UaqdQAC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.