A company plans to change a field on the Resource Card page in a Base Application.
You need to hide the field "Unit Price" from the Resource Card page.
Which code snippet should you use?
Correct Answer: D
To hide the field "Unit Price" from the Resource Card page in Microsoft Dynamics 365 Business Central, you need to modify the visibility property of the field using the modify keyword, which allows you to change the properties of an existing field on a page.
* modify("Unit Price") is the correct way to target an existing field on a page (like the Resource Card page).
* The line Visible = false; makes the field invisible on the page.
Here's a breakdown of why each option is right or wrong:
* Option A:
* Uses addlast("Unit Price"), which is incorrect because you are not adding a new field; you're modifying an existing one. Also, Visible = false is correct for hiding a field, but the wrong method (addlast) is used.
* Option B:
* Uses modify("Unit Price") with Enabled = false;. This would disable the field (make it non- editable), not hide it. The field would still be visible, so this does not meet the requirement.
* Option C:
* Uses addlast("Unit Price"), which is incorrect, and Enabled = false;, which would disable the field, not hide it.
* Option D:
* modify("Unit Price") { Visible = false; } is the correct syntax for hiding the field on the page.
Correct Code Snippet:
modify("Unit Price")
{
Visible = false;
}
This hides the "Unit Price" field from the Resource Card page.