Show/Hide field dynamically in page
catiamatos1991
Member Posts: 158
Hi everyone, I create a new field in Sales Header table called "Vasilhame" and this field only will be display when I choose a specific Posting No Series. So my idea was to include this field in my page and set the Visible property to a new boolean var I've created called ShowVasilhame.
This var have the option "Include In Dataset" equals to true and now I need to validate the change of Posting no Series equals to a specific text like "MRVFA" then this field should appear in my page, else it may still hide.
I create a function also called SetVasilhameVisibility(Show) where
Other code...
My problem is when I change the posting no series, because it stays visible and don't hide anymore...
This var have the option "Include In Dataset" equals to true and now I need to validate the change of Posting no Series equals to a specific text like "MRVFA" then this field should appear in my page, else it may still hide.
I create a function also called SetVasilhameVisibility(Show) where
LOCAL SetVasilhameVisibility(Value : Boolean) ShowVasilhame:=Value;
Other code...
OnInit() SetVasilhameVisibility(FALSE); IF "Posting No. Series"='MRVFA' THEN SetVasilhameVisibility(TRUE); OnOpenPage() IF "Posting No. Series"='MRVFA' THEN SetVasilhameVisibility(TRUE); Posting No. Series - OnValidate() IF "Posting No. Series"='MRVFA' THEN SetVasilhameVisibility(TRUE); Posting No. Series - OnLookup(VAR Text : Text) : Boolean Posting No. Series - OnDrillDown()
My problem is when I change the posting no series, because it stays visible and don't hide anymore...
0
Answers
-
[Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]
Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
1. Try to assign visible property of your field is "ShownVasilhame"
2. Update current page
LOCAL SetVasilhameVisibility(Value : Boolean){
ShowVasilhame:=Value;
CurrPage.Update(false)
}
I hope it will work.
0 -
If it is a card page, put your field in a separate group, and set the group visible or not.0
-
So I create a Group with the field Vasilhame inside and with the option visible equals to "ShowVasilhame". Then I add this code in OnValidate
Posting No. Series - OnValidate()
SetVasilhameVisibility("Posting No. Series"='MRVFA');
And I've update my SetVasilhameVisibility function to
SetVasilhameVisibility(Value : Boolean)
MESSAGE('vasilhame %1 ',Value);
ShowVasilhame:=Value;
CurrPage.UPDATE(FALSE);
But nothing changed.. The message is not being pop when I change the posting no series... any idea?
I've also remove the code in onInit and onOpenPage to validate the posting series no..0 -
@ACaignie is correct, you should be create sub-group, after that try to set visible this group.
I've already done that but is not working... maybe should be on another event rather than onValidate in Posting No series? In my opinion the correct event should be onLookup. I try to put the code in onLookup but the problem is that the dropdown box with the list of posting no series is not shown.. Only the pop up is shown but nothing else happen
Posting No. Series - OnLookup(VAR Text : Text) : Boolean
MESSAGE('nLoookup');
MESSAGE('test %1,',"Posting No. Series"='MRVFA');
//SetVasilhameVisibility("Posting No. Series"='MRVFA');
IF "Posting No. Series"='MRVFA' THEN
ShowVasilhame:=TRUE;
SetVasilhameVisibility(Value : Boolean)
MESSAGE('begin %1',Value);
ShowVasilhame:=Value;
CurrPage.UPDATE(FALSE);
The first and the second message is displayed but in my function SetVasilhameVisibility the message "begin" I put inside is not appearing.. I try to change my condition to a if but nothing.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
