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
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...
Answers
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
2. Update current page
LOCAL SetVasilhameVisibility(Value : Boolean){
ShowVasilhame:=Value;
CurrPage.Update(false)
}
I hope it will work.
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..
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.