SF-PD2 User Interface Practice Question
A developer is building a Lightning Web Component that needs to navigate to a specific record page when a user clicks a button. The developer wants to use the NavigationMixin from lightning/navigation. The component is a child component nested inside another component, and the developer needs to ensure that the navigation works correctly. Which code snippet correctly uses NavigationMixin to navigate to an Account record page?
⚠ Common exam trap
The trap here is using dot notation instead of bracket notation for the mixed-in Navigate method, or assuming Navigate can be called statically.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
this[NavigationMixin.Navigate]({ type: 'standard__recordPage', attributes: { recordId: '001...', objectApiName: 'Account', actionName: 'view' } });
The correct code uses this[NavigationMixin.Navigate] with a page reference object of type 'standard__recordPage'. This is the standard pattern for navigation in LWC. The mixin is applied to the class, and the Navigate method is accessed via bracket notation on the instance. The other options either use incorrect syntax or pass invalid arguments.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
this[NavigationMixin.Navigate]({ type: 'standard__recordPage', attributes: { recordId: '001...', objectApiName: 'Account', actionName: 'view' } });
Why this is correct
This snippet correctly uses the NavigationMixin.Navigate method with a page reference object. The type 'standard__recordPage' is used to navigate to a record page, and the attributes specify the recordId, objectApiName, and actionName. This is the standard way to navigate to a record page in LWC using NavigationMixin.
- ✗
NavigationMixin.Navigate(this, { type: 'standard__recordPage', attributes: { recordId: '001...', objectApiName: 'Account', actionName: 'view' } });
Why it's wrong here
This attempts to call Navigate as a static method on NavigationMixin, passing the component instance as the first argument. This is not how NavigationMixin works. The mixin is applied to the class, and the Navigate method is available on the instance. The correct usage is this[NavigationMixin.Navigate](pageReference).
- ✗
this[NavigationMixin.Navigate](pageReference); where pageReference is defined as a string URL.
Why it's wrong here
The Navigate method expects a page reference object, not a string URL. While there is a type 'standard__webPage' that accepts a URL attribute, the page reference must be an object with a type and attributes. Passing a string directly will not work. The developer must construct a proper page reference object to navigate to a record page.
- ✗
this.NavigationMixin.Navigate({ type: 'standard__recordPage', attributes: { recordId: '001...', objectApiName: 'Account', actionName: 'view' } });
Why it's wrong here
This syntax is incorrect because NavigationMixin is a mixin that must be applied to the component class, and its methods are accessed via the component instance using bracket notation. Using this.NavigationMixin.Navigate would not work because NavigationMixin is not a property on the instance; it is mixed into the class prototype. The correct access is via this[NavigationMixin.Navigate].
About these practice questions
One of 226 original SF-PD2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.