retURL=ApexPages.currentPage().getParameters().get('retURL')
idURL = Id.valueOf(retURL.removeStart('/'));Now when I try to create any record ,the below error is shown:Invalid id: lightning/cb/record-actions?objectApiName=Object_Name__c&actionName=new&inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX29iamVjdFBhZ2UiLCJhdHRyaWJ1dGVzIjp7Im9iamVjdEFwaU5hbWUiOiJDU1RfQ29udGFjdF9Sb2xlX19jIiwiYWN0aW9uTmFtZSI6Imxpc3QifSwic3RhdGUiOnsiZmlsdGVyTmFtZSI6IlJlY2VudCJ9fQ%3D%3D&0.source=alohaHeaderCould some one please check and suggest the way forward.Thaanks & Regards,Bsin1 answer
The Apex controller has no knowledge of the request that went to the browser, all it has is information that has been passed to the method call. You'll need to get the record in the lightning component, which is what the 'force:hasRecordId' interface is for:https://developer.salesforce.com/blogs/developer-relations/2015/11/building-context-aware-lightning-components.html⌗copied.Please mark this as solved if this solve your problem.