Hi All,
I want to Hide some fields based on some condition. for example, I have one field type of lookup and in that I have a lookup table, and I am selecting one option from there suppose 'Tangible' so based on Tangible option I want to hide some other fields and show some fields. I tried below code, but it didn't work.
>>Below is screen print for the Lookup field:
>>Here hideshow is variable of type boolean.
Can anyone give me a suggestion what is missing here? or any other way to achieve this?
Thank You.
That's nice to hear. Could you please verify my answer as the correct answer. Unfortunately, you chose yours instead.
Thank You GER_Nico , this solution is work for me.
Thank you so much once again.
Hello Inkey Solutions,
Unfortunately, it is not possible to show and hide fields dynamically. But where it works is with groups. I have no idea why it works for groups and not for fields. So you have to put the fields you want to show and hide in a group.
You can try it yourself with the following code:
page 50153 "TestPage" { ApplicationArea = All; Caption = 'TestPage'; PageType = Card; layout { area(content) { group(General) { field(OptionField; OptionField) { trigger OnValidate() begin if OptionField = OptionField::Option3 then isVisible := false else isVisible := true; end; } field(TextField1; TextField1){ Visible = isVisible; } group("HideGroup") { ShowCaption = false; Visible = isVisible; field(TextField2; TextField2){} } } } } trigger OnOpenPage() begin isVisible := true; end; var OptionField: Option Option1, Option2, Option3; TextField1, TextField2: Text[100]; [InDataSet] isVisible: Boolean; }
[View:/cfs-file/__key/communityserver-discussions-components-files/758/TestPage-_2D00_-Dynamics-365-Business-Central-_1320_-Microsoft_5F00_-Edge-2023_2D00_02_2D00_01-08_2D00_38_2D00_13-_2800_online_2D00_video_2D00_cutter.com_2900_.mp4:320:240
Warm greetings
Nico
Nitin Verma I already did this, but nothing work for me.
Thank you.
Hi,
Please declare your variable like below
var
[InDataSet]
hideshow :boolean;
and use that variable wherever you want.
Hi, Nitin Verma
Edited the post, please look into it.
Put your code in Text format not in Image.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156