Not able to navigate back to the record detail page after multiple attempts in iOS using lightning-navigation
Last updated 17 days ago ·Reference W-8836957 ·Reported By 1 users
In Review
Summary
Not able to navigate back to the record detail page after multiple attempts in iOS using lightning-navigation
Repro
1) Create an LWC component like below,
<template>
<lightning-record-edit-form record-id={recordId} object-api-name="Contact" onsuccess={handleSuccess} onsubmit={handleSubmit}>
<lightning-messages>
</lightning-messages>
<lightning-input-field field-name="FirstName"></lightning-input-field>
<lightning-input-field field-name="LastName"></lightning-input-field>
<lightning-input-field field-name="Email"></lightning-input-field>
<lightning-button class="slds-m-top_small" variant="brand" type="submit" name="update" label="Update">
</lightning-button>
</lightning-record-edit-form>
</template>
Js controller :
import { LightningElement,api } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
export default class NavigationLwcComp extends NavigationMixin(LightningElement) {
@api recordId='<any contact record Id>'; //Provide a contact Id record.
actId;
handleSubmit(event) {
console.log('onsubmit event recordEditForm'+ JSON.stringify(event.detail.fields));
}
handleSuccess(event) {
console.log('onsuccess event recordEditForm', event.detail.id);
this.actId = event.detail.id;
this.navigateToActivity();
}
navigateToActivity() {
this[NavigationMixin.Navigate]({
type: 'standard__recordPage',
attributes: {
recordId: this.actId,
objectApiName: 'Contact',
actionName: 'view'
}}, true);
}
}
XML:
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">;
<apiVersion>49.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
<target>lightning__Tab</target>
</targets>
<targetConfigs>
<targetConfig targets="lightning__RecordPage">
<supportedFormFactors>
<supportedFormFactor type="Large"/>
<supportedFormFactor type="Small"/>
</supportedFormFactors>
</targetConfig>
</targetConfigs>
</LightningComponentBundle>
2) hard-code a recordId value with a contact record id in JS controller.
3) Go to a contact page layout and add a custom tab (ex: Navigation) to the tabs standard component.
4) Add the custom LWC component to the custom tab & save it.
5) Login to salesforce using Salesforce for iOS, Go to contacts.
6) Go to the contact you hard-coded in js controller.
7) Goto Navigation tab, change last name field & click on Update (Observe that the we are navigated to contact record page).
8) Click on Navigation tab again and change last name & click on Update. (Observe that nothing happens).
Workaround
N/A
Reported By (1)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.
