Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Platform Developer II Topic 5 Question 113 Discussion

Actual exam question for Salesforce's Platform Developer II exam
Question #: 113
Topic #: 5
[All Platform Developer II Questions]

A developer is developing a reusable Aura component that will reside on an sObject Lightning page with the following HTML snippet:

How can the component"5 controller get the context of the Lightning page that the sObject is on without requiring additional test coverage?

Show Suggested Answer Hide Answer
Suggested Answer: A

By implementing force:hasSobjectName, the Aura component can retrieve the sObject context of the record page it is placed on without needing additional information. This interface provides the component with the API name of the sObject being displayed.


Aura Components Developer Guide

Contribute your Thoughts:

Chan
18 days ago
Wait, so we're supposed to get the context of the Lightning page without writing any tests? Sounds like a job for the magical App Builder fairies. D all the way!
upvoted 0 times
...
Cassandra
20 days ago
A? Really? Adding force:hasSobjectName to the implements attribute? That's like using a sledgehammer to crack a nut. D is the way to go, no doubt.
upvoted 0 times
...
Tarra
22 days ago
Hmm, B seems a bit too complicated. Why use an Apex class when we can just use the built-in Aura capabilities? I'd go with D.
upvoted 0 times
...
Lakeesha
1 months ago
Option C looks interesting, but I'm not sure if setting the sObject type as a component attribute is the best approach here. Seems like it might be a bit of a hack.
upvoted 0 times
Margurite
1 days ago
A: I think option D might be a better approach. Creating a design attribute and configuring it via App Builder seems more straightforward.
upvoted 0 times
...
...
Della
1 months ago
But wouldn't adding force:hasSobjectName provide the context of the Lightning page without needing additional test coverage?
upvoted 0 times
...
Nina
1 months ago
I think the answer is D. Creating a design attribute and configuring it via the App Builder seems like the most straightforward way to get the context of the Lightning page without additional test coverage.
upvoted 0 times
...
Sue
1 months ago
I disagree, I believe the correct answer is C) Set the sObject type as a component attribute.
upvoted 0 times
...
Della
2 months ago
I think the answer is A) Add force:hasSobjectName to the implements attribute.
upvoted 0 times
...

Save Cancel