Microsoft
MB-500 · Question #21
You are a Dynamics 365 Finance developer. You must extend the validateWrite method of the SalesLine table by using Chain of Command. The value of a variable named SalesPrice must be greater than or eq
Sign in or unlock MB-500 to reveal the answer and full explanation for question #21. The question stem and answer options stay visible for context.
Develop business logic
Question
You are a Dynamics 365 Finance developer. You must extend the validateWrite method of the SalesLine table by using Chain of Command. The value of a variable named SalesPrice must be greater than or equal to zero when adding new lines. You need to create an extension class. Which two code segments can you use? Each correct answer presents a complete solution. NOTE: Each correct selection is worth one point. A. B. C. D.
Exhibits
Options
- A[ExtensionOf(tableStr(SalesLine))] final class SalesLine_Extension { boolean validateWrite(boolean _skipCreditLimitCheck) { boolean ret; ret = next validateWrite(_skipCreditLimitCheck); if (ret && this.SalesPrice < 0) { ret = false; } return ret; } }
- B[ExtensionOf(tableStr(SalesLine))] final class SalesLine_Extension { boolean validateWrite(boolean _skipCreditLimitCheck = false) { boolean ret; ret = next validateWrite(_skipCreditLimitCheck); if (ret && this.SalesPrice < 0) { ret = false; } return ret; } }
- C[ExtensionOf(tableStr(SalesLine))] public class SalesLine_Extension { boolean validateWrite(boolean _skipCreditLimitCheck) { boolean ret; ret = next validateWrite(_skipCreditLimitCheck); if (ret && this.SalesPrice < 0) { ret = false; } return ret; } }
- D[ExtensionOf(tableStr(SalesLine))]
final class SalesLine_Extension
{
boolean validateWrite(boolean _skipCreditLimitCheck)
{
boolean ret;
try
{
ret = next validateWrite(_skipCreditLimitCheck);
}
catch (Exception::Error)
{
ret = false;
}
}if (ret && this.SalesPrice < 0) { ret = false; } return ret; }
Unlock MB-500 to see the answer
You've previewed enough free MB-500 questions. Unlock MB-500 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#Chain of Command#validateWrite#extension class syntax#X++ CoC



