0

I have a Case record detail page with a custom object on the related list section. I've overwritten the "New" quickaction of that custom object to a custom Visualforce page.

Here what I want to do is to press "New" - on this custom object which has a lookup to the Case - from a Related List on the Case object. When I press on the "New" of the custom object, I will navigate to that page - then I wont be in the Case Record page anymore.

The goal is to get the new record of the custom object to be related to that Case that stated the process. That's I need to get the Case RecordId on its controller. I've tried this on the page:

console.log(ApexPages.currentPage().getParameters().get('id'));

and this on the controller (extension):

public TFB_TM_TMChecklistNewController(ApexPages.StandardController controller){
        system.debug('URL ID: ' + controller.getId());
...

None of this worked.

The visualforce page has its controller and an extension:

apex:page standardController="TFB_TM_Checklist__c" extensions="TFB_TM_TMChecklistNewController"

Can someone advise? Thanks!

1 Answer 1

1

You can directly get that in vf page-

    <apex:page standardController="TFB_TM_Checklist__c" 
    extensions="TFB_TM_TMChecklistNewController">

    TFB_TM_Checklist Record Id is {!TFB_TM_Checklist__c.Id}

    </apex:page>
1
  • Thanks, but I wont be on the Case detail page anymore, since I would be brought to that visualforce page URL. So this would not work. Also, I need the ID of the existing Case, not the ID of the TFB_TM_Checklist__c that does not exist yet Nov 22, 2022 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .