Code Review Process & Shelvesets in Dynamics 365 Finance & Operations
Question 49 — Reviewing X++ safely with shelvesets and the Visual Studio code-review flow.
Interview Question
Model Answer (Short)
Code review is one of the essential quality tasks in any development project, so the process should be documented in the guidelines. In D365 F&O with Team Foundation Version Control, review is done using shelvesets and the built-in Visual Studio code-review flow. A shelveset is a set of pending changes the developer "shelves" on the server without checking them in — this lets a reviewer pull and inspect the exact changes safely. The developer requests a review against the shelveset, the reviewer adds comments and a verdict (e.g. approved / with comments / needs work), and only after the review passes are the changes checked in. The reviewer checks for best-practice/BP compliance, performance, security, naming conventions and extension-pattern adherence.
Detailed Explanation
What a shelveset is
- A server-stored set of pending changes that is not checked in.
- Lets a reviewer retrieve and inspect exactly what the developer changed.
- Keeps work-in-progress off the main branch until it is approved.
- Can be safely shared with reviewers and other developers.
The code-review flow
- The developer shelves their changes and requests a code review from Team Explorer.
- The reviewer opens the shelveset, examines the diff and adds comments.
- The reviewer submits a verdict (approved / with comments / needs work).
- Once approved, the developer checks in the changes with a proper changeset name.
What the reviewer checks
- Best-practice compliance — no unresolved BP errors/warnings.
- Performance — no nested loops, set-based ops, field lists, correct indexing.
- Security — no hardcoded credentials, correct roles/data access.
- Naming conventions and the extension pattern are followed.
- Comments, exception handling and test coverage are adequate.
Prerequisites (Rule 5)
- Visual Studio with the Dynamics 365 developer tools.
- A connected Team Foundation Version Control repository (DevOps).
- A mapped workspace with pending changes to shelve.
- A nominated reviewer in the team.
Steps — Requesting a Review via Shelveset
| Step | Action |
|---|---|
| 1 | In Team Explorer → Pending Changes, review your changes |
| 2 | Click Shelve and give the shelveset a clear name |
| 3 | Choose Request Review and select the reviewer(s) |
| 4 | Reviewer opens the shelveset, adds comments and a verdict |
| 5 | Address feedback, then Check in with a valid changeset name |
Example — Shelveset & changeset naming
# Shelveset name (descriptive, ties to the work item)
Abc_FIN01_InvoiceValidation_Review_ADO12345
# After approval, check in using the changeset naming standard
GLB_REL_12345_FIN_01_SIT_20260728_1030
# Region_Type_ADOID_FDSID_Phase_YYYYMMDD_HHMM
Copilot as a first-level reviewer (prompts)
# Use Copilot chat to assist BEFORE the human review:
- "Scan for hardcoded passwords or credentials"
- "Check for nested while loops and suggest set-based alternatives"
- "Verify naming convention and extension pattern adherence"
- "Identify any missing field lists in select statements"
Points the interviewer wants to hear
- Code review is an essential quality task and should be documented in the guidelines.
- A shelveset stores pending changes on the server without checking in.
- Flow: shelve → request review → verdict → check in.
- Reviewers check BP, performance, security, naming and extension patterns.
- Copilot can perform a helpful first-level review before peer review.
Likely Follow-up Questions
- What is a shelveset and how does it differ from a check-in?
- Why review code from a shelveset rather than after check-in?
- What are the top things you look for in an X++ code review?
- How can GitHub Copilot support the code-review process?
Key Takeaway
Code review is a mandatory quality gate. Use a shelveset to share pending changes safely, run them through the Visual Studio review flow (shelve → request → verdict → check in), and verify BP, performance, security, naming and extension patterns — with Copilot assisting as a first-level reviewer.