SHARING-AND-VISIBILITY-ARCHITECT practice question 7 of 15

A consulting company uses the Salesforce mobile app for its field consultants and uses Case object to track customer specific consulting done by…

Full set: 78 questions

Domain Special Use Cases

A consulting company uses the Salesforce mobile app for its field consultants and uses Case object to track customer specific consulting done by field consultants. The company also has a large number of customer service representatives who takes calls from customers on company issued desktops and uses case object to track customer issues and grievances. The company would like to capture images of customer site captured by field consultants while they are editing the case record during customer site visit. The Director of IT wants to minimize customization and promote reuseability of code artifacts wherever possible. What recommendations should an architect give to the company to implement the image capture requirement, while ensuring customer that the service rep can continue to use same lightning pages they were trained to use?
Answer options
A: Use Lightning Component as an override for “Edit” action on mobile view allowing image capture feature. No Change required for desktop users.
B: Use Lightning Component as an override for “Edit” action on lightning experience allowing image capture feature. Detect the form factor of the device and redirect the user to the default not overridden view. Correct answer
C: Create a separate button “Edit in Mobile”, which opens a custom lightning component that will allow field consultants to add an image. No change required for desktop users.
Correct Answer:
B. Use Lightning Component as an override for “Edit” action on lightning experience allowing image capture feature. Detect the form factor of the device and redirect the user to the default not overridden view.
Explanation

The most effective and scalable solution is to override the standard "Edit" action with a single Lightning component. Within this component, the @salesforce/client/formFactor scoped module can be used to determine the user's device type. If the form factor is 'Large' (desktop), the component can use the lightning/navigation service to redirect the user to the standard edit page, ensuring their experience remains unchanged. If the form factor is 'Small' (mobile), the component will render the custom UI with the image capture functionality. This approach minimizes customization to a single component, promotes code reuse, and seamlessly handles the different user experiences without introducing new UI elements.

Why Incorrect

A. Use Lightning Component as an override for “Edit” action on mobile view allowing image capture feature. No Change required for desktop users. This is incorrect because a standard action override in Lightning Experience applies to all form factors (desktop and mobile). It is not possible to create an override for only the mobile view.
C. Create a separate button “Edit in Mobile”, which opens a custom lightning component that will allow field consultants to add an image. No change required for desktop users. This is a less optimal solution. It adds a new UI element, which can be confusing for users, and requires separate page layout configurations, increasing administrative overhead and not fully leveraging standard actions.

References

1. Lightning Web Components Developer Guide - formFactor: The @salesforce/client/formFactor module provides information about the form factor of the hardware running the browser. This allows a component to adapt its rendering based on whether it's running on a desktop (Large), tablet (Medium), or phone (Small). This is the core mechanism for the solution in option B.

Source: Salesforce Lightning Web Components Developer Guide, Reference, Modules, @salesforce/client/formFactor.

2. Lightning Web Components Developer Guide - lightning/navigation: The lightning/navigation service is used to navigate to different pages, including standard record pages in edit mode. This is how the component in option B would redirect desktop users to the standard experience.

Source: Salesforce Lightning Web Components Developer Guide, Reference, lightning/navigation, "Navigate to a Record's Edit Page".

3. Salesforce Help - Override Standard Actions with a Lightning Component: Official documentation states that when you override a standard action, the override applies across both Lightning Experience on the desktop and the Salesforce mobile app. This directly invalidates the premise of option A.

Source: Salesforce Help, Salesforce Mobile App Developer Guide, "Override Standard Actions". The documentation notes, "When you override a standard action on an object, that override applies to both Lightning Experience and the Salesforce mobile app."

Scroll to Top