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.
  • r u using visualforce/lightning out approach? – sdandamud1 Nov 1 '19 at 15:56
  • I am doing it through lightning component – Deepak Agarwal Nov 1 '19 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 Nov 1 '19 at 17:24
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
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.