Testing, Debugging Deployment 2,3 Flashcards

(7 cards)

1
Q

A developer has written an Apex Trigger. She tested it and the trigger is not functioning as expected. She now wants to debug the code. How can the developer accomplish this in the Developer Console?

Choose 1 answer.

A. Go to the Anonymous Window in Developer Console.
B. Go to the Progress tab in Developer Console.
C. Go to the Run Tests in Developer Console.
D. Go to the Logs tab in Developer Console.

A

D. Go to the Logs tab in Developer Console.

🧠 Explanation:
✅ Option D is correct. The Logs tab in Developer Console shows detailed execution logs, including operations performed during trigger execution. This allows the developer to trace the issue line-by-line using debug logs.

❌ Option A (Anonymous Window) is used to execute arbitrary Apex, not for viewing logs.
❌ Option B (Progress tab) shows progress of long-running operations but not debug logs.
❌ Option C (Run Tests) is used to execute and view test results, not to debug existing trigger executions.

🔗 Documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_log_console.htm

📚 Additional resources:
- https://trailhead.salesforce.com/content/learn/modules/apex_testing/apex_testing_intro
- https://developer.salesforce.com/blogs/2020/08/debugging-in-the-developer-console

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a debug level used for?

Choose 1 answer.

A. A debug level is used to specify how long the debug logs are stored before being deleted automatically.
B. A debug level is used to specify the type and amount of information that is logged in a debug log.
C. A debug level is used to specify the user or entity type for which the debug log captures information.
D. A debug level is used to specify the access level required for users in order to access debug logs.

A

B. A debug level is used to specify the type and amount of information that is logged in a debug log.

🧠 Explanation:
✅ Option B is correct. In Salesforce, a debug level determines what types of information (like Apex code, workflows, validation rules, etc.) are captured in the debug log, and at what level of detail (e.g., NONE, ERROR, INFO, DEBUG, FINE, etc.).

❌ Option A is incorrect: Debug level doesn’t control log retention.
❌ Option C is incorrect: Log filters or trace flags determine which user or entity is being logged.
❌ Option D is incorrect: Access to logs is governed by user permissions, not debug level.

🔗 Documentation:
https://help.salesforce.com/s/articleView?id=sf.code_add_users_debug_log.htm

📚 Additional resources:
- https://trailhead.salesforce.com/content/learn/modules/apex_debugging/apex_debugging_debug_logs
- https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_debugging_debug_log_levels.htm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A sales user named ‘Jack’ owns a number of opportunities in an org with a private sharing setting for the Opportunity object. Another user named ‘Jill’ is assigned to the same profile as Jack but is appointed to a lower role in the org’s role hierarchy. If Jill has been given the ‘Author Apex’ permission and anonymously runs Apex code written to query and update opportunities owned by Jack, which of the following is a valid result?

Choose 1 answer.

A. Jack’s opportunities will be updated due to the ‘Author Apex’ permission regardless of Jill’s access level.
B. Jack’s opportunities will be updated since anonymous code will always be executed in system mode.
C. The anonymous code will update the opportunities but roll the changes back once the transaction completes.
D. The anonymous code cannot update Jack’s opportunities since Jill lacks permission to access the records.

A

D. The anonymous code cannot update Jack’s opportunities since Jill lacks permission to access the records.

🧠 Explanation:
✅ Option D is correct. Anonymous Apex runs in user mode, not system mode, meaning it respects record sharing rules and object/field-level security. Because Jill is at a lower level in the role hierarchy and the sharing model for Opportunities is private, she cannot access Jack’s records even if she runs Apex anonymously.

❌ Option A is incorrect – ‘Author Apex’ simply allows the user to execute anonymous Apex, but does not override sharing settings.
❌ Option B is incorrect – Anonymous Apex runs in user mode, not system mode.
❌ Option C is incorrect – There’s no automatic rollback unless explicitly coded.

🔗 Documentation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_keywords_sharing.htm

📚 Additional resources:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The level of debugging information logged can be set for which of the following debug log categories?

A. Visualforce
B. Apex Code
C. Reports
D. Lightning Components

A

A, B
✅ A. Visualforce: Salesforce permite configurar el nivel de detalle para la categoría de Visualforce en los registros de depuración, útil para identificar problemas de renderizado o ejecución en páginas VF.

✅ B. Apex Code: Esta es una de las categorías principales para depuración. Permite establecer niveles como DEBUG o ERROR para registrar llamadas, ejecuciones de métodos, excepciones y más.

❌ C. Reports: No es una categoría de depuración configurable. La ejecución de reportes no se detalla en los logs del sistema como una categoría individual.

❌ D. Lightning Components: Aunque se pueden rastrear algunos eventos, no existe como categoría independiente en los registros de depuración configurables.

🔗 Documentación oficial:
- Set Debug Log Levels
- Debug Log Categories and Tracing Levels

📚 Recursos adicionales:
- Trailhead: Debugging Apex
- Salesforce Help: Debug Logs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A Salesforce developer would like to use Code Builder in working on the next Salesforce DX project. Which of the following statements are valid regarding Code Builder?

A. Updating the Salesforce Extension pack can easily be performed with a single button click.
B. Code Builder consumes less storage drive space of the local machine as it is lightweight.
C. Installing the Code Builder managed package is required in order to use Code Builder.
D. Like Visual Studio Code, extensions can easily be installed from the Microsoft Marketplace.

A

C
✅ C. Code Builder is launched from the org and requires that the Code Builder managed package be installed first. This package provides the entry point to launch the web-based IDE and authenticate with your org.

❌ A. The Salesforce Extension Pack in Code Builder is updated automatically by Salesforce; users don’t need to perform updates manually.

❌ B. While true that Code Builder doesn’t consume local storage space, this answer is not as complete or accurate in addressing the question about Code Builder setup and usage.

❌ D. Code Builder does not support the Microsoft Marketplace. Instead, it supports the Open VSX marketplace for installing additional extensions.

🔗 Documentación oficial:
- Salesforce Help: Get Started with Code Builder
- Salesforce Code Builder Overview

📚 Recursos adicionales:
- Trailhead: Develop with Code Builder (Beta)
- Salesforce Developers Blog – Code Builder

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A developer is required to know the number of SOQL queries initiated in a single Apex trigger transaction along with its limit usage. What is the recommended debug level for the Apex Profiling category on the developer’s trace flag for this requirement?

A. ERROR
B. DEBUG
C. FINEST
D. NONE

A

C
✅ C. The FINEST debug level is the most detailed setting and is recommended for capturing complete Apex Profiling data, including the number of SOQL queries and their governor limit usage.

❌ A. ERROR only logs error-level information and is too limited for this purpose.
❌ B. DEBUG gives general debugging information but not the full profiling metrics.
❌ D. NONE disables logging entirely, which is not useful for debugging or profiling.

🔗 Documentación oficial:
- TraceFlag | Tooling API Developer Guide
- Set Debug Log Levels

📚 Recursos adicionales:
- Trailhead: Debug and Fix Apex Errors
- Salesforce Developer Guide: Debug Log Categories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A third-party API endpoint that is designed to return posts from an external platform was introduced to the developer team of a digital marketing company. The senior developer would like to quickly evaluate the API first by performing test callouts to an endpoint and examining the returned responses. What is a suitable option to complete the task?

A. Execute an anonymous block
B. Create an outbound message
C. Build a Lightning component
D. Write a unit test for the callout

A

A
✅ A. Executing an anonymous block allows the developer to make real HTTP callouts directly from the Developer Console or VS Code, enabling quick and flexible testing of external APIs without building UI or deploying components.

❌ B. Outbound messages are limited to workflow-based automation and don’t support reading or analyzing responses.

❌ C. Lightning components are not suitable for quick backend testing due to the need for additional setup and UI.

❌ D. Unit tests in Salesforce require mock responses; they don’t hit real endpoints, making them unsuitable for real-time evaluation.

🔗 Execute Anonymous Apex Code
🔗 Making HTTP Callouts from Apex

📚 Trailhead Modules:
- Apex Integration Services
- Asynchronous Apex

How well did you know this?
1
Not at all
2
3
4
5
Perfectly