martonsagi / al-object-designer

AL Object Designer for Dynamics 365 Business Central development
MIT License
39 stars 21 forks source link

Feature Request: Automatically add page field caption #21

Closed pcucuk closed 4 years ago

pcucuk commented 5 years ago

It would be nice if, after creating a page from table, the fields gets assigned default caption based on the field name.

Current generated code:

field("SomeField"; "SomeField")
{

}

Requested:

field("SomeField"; "SomeField")
{
        Caption = 'SomeField';
}

Loving the extension by the way :)

martonsagi commented 5 years ago

Hi,

I'm not sure in which case would this be useful. In the background, Page field captions are inherited from table field captions. So if you have captions set on table fields, you don't necessarily need to define and maintain captions on pages as well.

How about adding the table field caption as a commented out property?

Source Table:

field(15; "SomeField"; Code[20])
{
    Caption = 'Some Caption';
}

Generated Page:

field("SomeField"; "SomeField")
{
    //Caption = 'Some Caption';
}
pcucuk commented 5 years ago

I never thought to check, but I just always assumed that I needed to add the caption property else it wouldn't be included in the translation.xliff file. I'll check when I have the time and let you know.