Sales Invoice SSRS Custom Fields via CoC

MB-500 By islever Editorial Last updated

Short answer

B The new method is never invoked by Chain of Command and cannot resolve SalesTable fields from a CustInvoiceJour parameter, so the custom fields stay blank.

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
A company is using a Dynamics 365 finance and operations app.
The accounting department requests two custom fields named CusStatus and CusDiscount for the header of the sales invoice SSRS report. The custom fields are in the SalesTable table.
You create a duplicate of the report design and add the two new fields to a temporary table by using the following extension:
Exhibit: Sales Invoice SSRS Custom Fields via CoC
You need to populate the new fields by using Chain of Command (CoC).
Solution: Create a new method on the MySalesInvoiceDP_Extension class named populateInvoiceHeaderFooterCustom which uses the CustInvoiceJour table as a parameter. Declare the SalesTable and SalesInvoiceHeaderFooterTmp tables on the new method. Populate the new fields by using the _custInvoiceJour parameter to reference SalesTable.
Does the solution meet the goal?
  1. Yes
  2. No Correct Answer

Key Takeaways

The trap is assuming that adding a method to a data-provider extension class automatically executes it; CoC only runs a method that wraps an existing one with next, and the key relationship must actually resolve SalesTable.

This MB-500 scenario tests whether a Chain of Command method on MySalesInvoiceDP_Extension can populate CusStatus and CusDiscount on the sales invoice SSRS report; the answer is B, No, because the described method is never called and cannot reach SalesTable from a CustInvoiceJour parameter.

Common mistake: Choosing A (Yes) because the method name, class extension and temporary table all look plausible, overlooking that nothing invokes the method and that a CustInvoiceJour parameter does not expose SalesTable fields without a SalesId lookup.

Expert Analysis

The scenario in detail SalesTable has just gained two extension fields, CusStatus and CusDiscount. The analyst created a copy of the sales invoice SSRS design and pointed the new fields at a temporary table, then declared an extension on the data-provider class MySalesInvoiceDP_Extension. The question is whether the proposed CoC method actually fills those two temp-table columns.

Why the proposed method fails The method described, populateInvoiceHeaderFooterCustom on MySalesInvoiceDP_Extension taking a CustInvoiceJour parameter, is a brand-new method, not an override of an existing data-provider method. Chain of Command only fires when an extension wraps an existing AOT method and calls next. A method nobody calls is never executed by the framework, so the temp table stays empty and both custom fields render blank. The solution as written also never shows the wrapper that would invoke it after next.

Where the reference data would have to come from Even inside a real CoC wrap, the routing matters. populateInvoiceHeaderFooterCustom receives a CustInvoiceJour (invoice journal), and that record does not expose SalesTable fields directly; a SalesTable declaration plus a lookup keyed on the journal's SalesId (or the SalesInvoiceJour linkage) is required before CusStatus and CusDiscount can be copied into SalesInvoiceHeaderFooterTmp. The stated instruction to 'use the _custInvoiceJour parameter to reference SalesTable' does not do that lookup, so it cannot resolve the header fields.

What a working approach looks like The correct pattern is to wrap the existing SalesInvoiceDP method that populates SalesInvoiceHeaderFooterTmp, call next to run the standard logic, then select SalesTable by SalesId from the journal in scope and set the extension fields on the temp record. Alternatively, resolve the fields through a join inside the existing report extension. Both approaches guarantee execution and a valid key relationship.

The operational consequence Answering Yes here means a live report with blank custom columns and no runtime error to warn you, which is exactly the failure mode that surfaces in production. On the exam, treat any new method added to an extension class as inert unless the solution explicitly names the wrapped method and the next call.

Exam Strategy

For CoC questions, first confirm the solution names an existing AOT method being wrapped and shows the next call; a brand-new method on an extension class is inert. Then check that the parameter passed in can actually supply the requested SalesTable fields, since invoice-journal records need a SalesId lookup. Apply this two-step test to every 'Does the solution meet the goal?' item in this series.

Frequently Asked Questions

Why doesn't a new method on MySalesInvoiceDP_Extension run automatically?

Chain of Command only intercepts existing AOT methods when an extension wraps them and calls next. A newly added method has no caller in the framework, so it never executes unless the solution explicitly invokes it from the wrapper.

How should the custom SalesTable fields actually reach SalesInvoiceHeaderFooterTmp?

Wrap the data-provider method that fills the header/footer temp table, call next, then select SalesTable by SalesId derived from the invoice journal in scope and set the extension fields on the temp record before the report renders.

Can CustInvoiceJour be used to read SalesTable fields directly?

No. CustInvoiceJour carries invoice-journal data, so you must resolve the related sales order through SalesId (or the SalesInvoiceJour linkage) before CusStatus and CusDiscount can be copied.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 1 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 1

  1. cbef765 👍 1 Answered B
    Answer: B. No Why: This solution fails for three reasons. 1. Nothing calls the new method. It adds populateInvoiceHeaderFooterCustom as a brand-new method on the extension class, but the solution never says to call it from the wrapper, for example after next on line 08. The framework doesn’t run new methods on its own, so it would just sit there unused. 2. It isn’t Chain of Command. CoC means wrapping an existing method, here populateSalesInvoiceHeaderFooterTmp, and adding your logic around next. A separate new method with its own name doesn’t wrap anything, so it doesn’t meet the “by using CoC” requirement. 3. It declares a new SalesInvoiceHeaderFooterTmp buffer. That’s the same problem as the last question. A local variable of that type is a separate, empty buffer. The report reads the class’s own member buffer, which the standard code fills inside next. Anything you write to a local copy never reaches the report. What is should be is : next populateSalesInvoiceHeaderFooterTmp(_custInvoiceJour, _companyInfo); SalesTable salesTable = _custInvoiceJour.salesTable(); salesInvoiceHeaderFooterTmp.CusStatus = salesTable.CusStatus; salesInvoiceHeaderFooterTmp.CusDiscount = salesTable.CusDiscount; salesInvoiceHeaderFooterTmp.update();

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All MB-500 Questions

Access 115 questions with complete answers and detailed explanations.

View Full MB-500 Practice Test →

← Back to MB-500 Study Guide