0

I have a requirement where in i have over ridden the standard case button in contact related list. Now when i click 'New' in Case under contact related list a popup with few fields is opened but this takes to case tab and recordId of contact is lost,where in i want to redirect my page back to contact record page on click of any button in modal popup. Tried following approach but i am not getting recordId since page is navigating to case object.

Initial contact url--lightning/r/Contact/0035400000NIr0ZAAT/view

Case URL--lightning/o/Case/new?inContextOfRef=1.eyJ0eXBlIjoic3RhbmRhcmRfX3JlY29yZFBhZ2UiLCJhdHRyaWJ1dGVzIjp7InJlY29yZElkIjoiMDAzNTQwMDAwME5JcjBaQUFUIiwiYWN0aW9uTmFtZSI6InZ

This code i am using for redirect to contact record page.

logFeedback:function(component){
    component.find("navId").navigate({
        type: 'standard__recordPage',
        attributes: {
            recordId : component.get("v.recordId"), // record id from given objectApiName
            actionName: 'view',
            objectApiName:'Contact'
        }}, true);

But since record id is gone its not redirecting.

Any other suggestions/alternative approach.
3
  • r u using visualforce/lightning out approach?
    – sdandamud1
    Commented Nov 1, 2019 at 15:56
  • I am doing it through lightning component Commented Nov 1, 2019 at 17:11
  • that means you are trying to override the standard New case button, that's why it's redirect to standard case tab, by this approach you can't get the contactid. there is idea success.salesforce.com/ideaView?id=0873A0000003TXFQA2 . but you can achieve your use case by using visualforce-lightningout-custombutton
    – sdandamud1
    Commented Nov 1, 2019 at 17:24

1 Answer 1

1

that means you are trying to override the standard New case button, that's why it's redirect to standard case tab, by this approach you can not get the contactid. there is idea .

but you can achieve your use case

1 .by using visualforce-lightningout-custombutton
2 . you can add custom action in record detail page like beside in `edit` button it 
    opens your lightning component  then get contact id by using `force:hasRecordId` 
    get record id
3

You must log in to answer this question.

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