al-code-outline
al-code-outline copied to clipboard
Add Tooltip: Consider Tablefield Caption
Hi Andrzej, thanks for the Add Tooltip command. We used it last time and it worked pretty good, but there's one thing which would be good to be improved. The issue is with table extensions and with "MemberAccessExpressions" like NewTable.NewField. In these cases the Tablefield Caption isn't considered (see my two comments in the "after"-example at the last two page fields) But in other cases it works like a charm (see the page 50100). I reproduced it with this simple project. Do you think that's possible to add? Before command:
table 50100 NewTable
{
fields
{
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
tableextension 50100 "DFECustomerExt" extends Customer
{
fields
{
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
page 50100 NewPage
{
SourceTable = NewTable;
layout
{
area(Content)
{
field(DFENewField; Rec.DFENewField)
{
}
}
}
}
pageextension 50100 DFECustomerListExt extends "Customer List"
{
layout
{
addlast(content)
{
field(DFENewFieldWithCaption; Rec.DFENewField)
{
Caption = 'Pagefield Caption';
}
field(DFENewFieldWithoutCaption; Rec.DFENewField)
{
}
field(NewTable; NewTable.DFENewField)
{
}
}
}
var
NewTable: Record NewTable;
}
After command "Add Tooltip"
table 50100 NewTable
{
fields
{
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
tableextension 50100 "DFECustomerExt" extends Customer
{
fields
{
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
page 50100 NewPage
{
SourceTable = NewTable;
layout
{
area(Content)
{
field(DFENewField; Rec.DFENewField)
{
ToolTip = 'Specifies the value of the Tablefield Caption field';
}
}
}
}
pageextension 50100 DFECustomerListExt extends "Customer List"
{
layout
{
addlast(content)
{
field(DFENewFieldWithCaption; Rec.DFENewField)
{
Caption = 'Pagefield Caption';
ToolTip = 'Specifies the value of the Pagefield Caption field';
}
field(DFENewFieldWithoutCaption; Rec.DFENewField)
{
ToolTip = 'Specifies the value of the DFENewField field'; //Not expected: Would like to have the Tablefield Caption
}
field(NewTable; NewTable.DFENewField)
{
ToolTip = 'Specifies the value of the NewTable.DFENewField field'; //Not expected: Would like to have the Tablefield Caption
}
}
}
var
NewTable: Record NewTable;
}
It is a bug, I have to fix it.
Nice, thanks :)
I've fixed it and released a new version of the extension.
Hi Andrzej, thanks for your effort so far. Unfortunately, it is not working entirely. But I guess it's another issue, I found. The caption of a field, declared in a table extension, is not taken into account, if inside the table extension is a field modification as well. See the example:
table 50100 NewTable
{
fields
{
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
tableextension 50100 "DFECustomerExt" extends Customer
{
fields
{
modify("No.") { Description = 'Test'; } //because there's a field-modification the caption is not taken anymore into account
field(50100; DFENewField; Text[250]) { Caption = 'Tablefield Caption'; }
}
}
page 50100 NewPage
{
SourceTable = NewTable;
layout
{
area(Content)
{
field(DFENewField; Rec.DFENewField)
{
}
}
}
}
pageextension 50100 DFECustomerListExt extends "Customer List"
{
layout
{
addlast(content)
{
field(DFENewFieldWithCaption; Rec.DFENewField)
{
Caption = 'Pagefield Caption';
}
field(DFENewFieldWithoutCaption; Rec.DFENewField)
{
}
field(NewTable; NewTable.DFENewField)
{
}
}
}
var
NewTable: Record NewTable;
}
The result is the same as in my previous post (Tooltip uses DFENewField as Caption). As far as I throw away the field modification, reload the window (I guess you're caching something?) and rerun the command, everythings fine.
Hi David
Thank you for reporting this problem. I've released a new version of the extension and fixed these 2 issues:
- extension was crashing if there was a field modification in the table extension.
- changes to the field captions in the field modification were ignored Unfortunately symbol references file inside the app file does not contain information about field changes, so if a field caption is changed by one of the dependencies of your project, tooltip/caption commands won't see it.
Thanks, Andrzej :) I'll test it out the next days!
Hi Andrzej, I can't tell you why, but in some cases it's not working. I have a case where in a page extension a field of a table extension (of the same project) is added, but the caption is not taken of the table extension. But in some other cases it works... Should wo look at it together and debug through it? I can't tell you exactly what's the difference there..