MB-820 · Question #87
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? A. B. C. D.
The correct answer is D. modify("Unit Price") { Visible = false; }. Option D is correct because modify is the proper keyword for changing properties of an existing field on a Base Application page - "Unit Price" already exists on the Resource Card, so you modify it rather than adding it. Setting Visible = false completely hides the field from…
Question
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? A. B. C. D.
Options
- Aaddlast ("Unit Price") { Visible = false; }
- Bmodify("Unit Price") { Enabled = false; }
- Caddlast ("Unit Price") { Enabled = false; }
- Dmodify("Unit Price") { Visible = false; }
How the community answered
(24 responses)- A4% (1)
- B13% (3)
- C4% (1)
- D79% (19)
Explanation
Option D is correct because modify is the proper keyword for changing properties of an existing field on a Base Application page - "Unit Price" already exists on the Resource Card, so you modify it rather than adding it. Setting Visible = false completely hides the field from the UI, which is exactly what "hide" means in Business Central AL.
Option B is close but wrong: Enabled = false only grays out the field and makes it non-interactive, but it remains visible on the page - that's disabling, not hiding.
Options A and C both use addlast, which is for adding new controls to a page. Since "Unit Price" already exists in the Base Application, using addlast would cause a compilation error; you must use modify to change existing controls.
Memory tip: Think "M-V: Modify to Vanish" - you Modify existing fields, and Visible = false makes them vanish. If you want to disable (dim), use Enabled; if you want to disappear, use Visible.
Topics
Community Discussion
No community discussion yet for this question.