Wednesday, November 28, 2018

What are NotBlank, ShowMandatory, UpdatePropagation and ApplicationArea page properties in dynamics 365 business central?

NotBlank, ShowMandatory, UpdatePropagation and ApplicationArea.



NotBlank & ShowMandatory

The property “NotBlank” is used on the field level and the control level. So, you can find this property on the fields 
of a table, or on the control of a page. This indicates that this field is mandatory, and it displays an error when the 
user saves with a blank mandatory field. If you set this property on the field level, then it will always be mandatory 
on the control level as well.

The ShowMandatory only gives you a visual indication that a field is mandatory, but it doesn’t give an error if you 
leave the field blank. The indication is done with a red asterisk.
So, the ShowMandatory property is not the same as NotBlank, but can be used in combination.



UpdatePropagation


The UpdatePropagation property gives an answer to what must happen when a subpage is updated. Should the mainpage be updated as well? This property has 2 options:

Subpage: this won’t update the mainpage
Both: this will result in an update of both the subpage and the mainpage


ApplicationArea

This property is found on field, part and action controls. It is a text string that contains a comma-separated list of application area tags.

An application area tag must have the format #name, where name is the application area. It can be a combination of letters and numbers without spaces. So, to specify the Basic and Fixed Assets application areas, the property can be set to #Basic, #FixedAssets.


You can set the property to All, when the control applies to all application areas. This means that the control will always appear in the user interface. It's very important to remember that if one or more application areas are enabled in a session, any controls that are not tagged with an application area will not appear in the user interface.


How to setup these fields in AL Code inside Visual Studio?

page 50101 "Car List"
{
CaptionML=ENU='Car List',NLB='Autolijst',FRA='List de voitures';
PageType=List;
CardPageID="Car Card";
SourceTable=Car;

layout
{
area(content)
{
repeater(Group)
{
field("No."; "No.")
{
ApplicationArea=All;
}
field(Name; Name)
{
ApplicationArea=All;
}
field(Type; Type)
{
ApplicationArea=#Basic;
}
}
}
}
}


No comments:

Post a Comment