
Is it possible to dynamically set the visibility of a repeater field, such as a column in the Sales Lines on a Sales Order? For example, I only want to display the "Action" field column on the Sales Lines if a condition in the Sales Header is met.
I know it's possible to do this dynamically using a Group and a global boolean variable for something in the header. But there is no group property for repeater fields. Is there a way around this?
Hello,
You can do it by customization, for reference see the below code.
pageextension 50103 "Page46 Ext" extends "Sales Order Subform"
{
layout
{
modify("Location Code")
{
Visible = IsLocationVisible;
}
}
trigger OnAfterGetRecord()
begin
CheckLocationVisibility();
end;
trigger OnOpenPage()
begin
CheckLocationVisibility();
end;
local procedure CheckLocationVisibility()
begin
if SalesHeaderG.Get("Document Type", "Document No.") then
if SalesHeaderG."Location Code" = '' then
Clear(IsLocationVisible)
else
IsLocationVisible := true;
end;
var
SalesHeaderG: Record "Sales Header";
[InDataSet]
IsLocationVisible: Boolean;
}
Note: When you next/previous the record, it will visible the location code dynamically based on header Location code.