Question 34 of 103 from exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

Question 34 of 103 from exam MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer

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.

[extensionOf(tablestr(SalesLine) ) ]
public class SalesLine_extension

{

boolean validateWrite(boolean _skipCreditLimitcheck)

{

boolean ret;
ret = next validatewrite(_skipCreditLimitcheck) ;

if (ret && this.SalesPrice < @)
{

ret = false;

t

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 < @)
{

ret = false;

}

return ret;

}

C.

[ExtensionOf(tableStr(SalesLine))]

final class SalesLine_Extension

{
boolean validateWrite(boolean _skipCreditLimitCheck)
{

boolean ret;

ret = next validateWrite(_skipCreditLimitCheck) ;
if (ret && this.SalesPrice < @)

{

ret = false;
+
return ret;

D.

[extensionOf(tablestr(SalesLine) ) ]
final class SalesLine_extension

{

boolean validateWrite(boolean _skipCreditLimitcheck)

{

boolean ret;

try
{
ret = next validatewrite(_skipcreditLimitcheck) ;

+
catch
{

ret = false;
+
if (ret && this.SalesPrice < @)
{

ret = false;
+
return ret;

+

Explanations

AD.

Incorrect Answers: B: Can't use = false in the 4th line.

C: Second line must be start final class, public class Reference: https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/data-entities/validations-defaults-unmapped-fields https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/extensibility/method-wrapping-coc.