This how-to is really great for beginners. When I was new in Navision programming world, it took me much time until I discovered how to pass parameters. I think, Navision (ehm, now MBS) should write better documentation for programmers, which should include "cheats" like this; documentation as Application designer's guide is insufficient, because it does not contain basic ideas.
I have tried this and I have a Codeunit like this.
MESSAGE('HER ER før RESULTATET: %1',Comp);
form1.RUNMODAL;
MESSAGE('RESULT: %1',Comp);
SetSelskap(Selskap : Text[50])
Comp := Selskap;
MESSAGE('Value of Comp: %1',Comp);
Then I have Form, form1 whch gives a value to Selskap by calling the function Setselskap. The Message(Value of Comp: shows that the value of Comp is set correctly. and Comp is a variable in the Codeunit.
But at tyhe code( MESSAGE('RESULT',%1',Comp); THE VALUE OF Comp IS LOST
I am trying to pass a parameter from a page to a codeunit function that should start an report with the given parameters in the first place. The problem is that when the parameters are passed to the codeunit, the Record looses the filters. The Variable in the Codeunit is of type "Variant".
Could anybody give a hint as to why this happends? [-o<
Comments
MESSAGE('HER ER før RESULTATET: %1',Comp);
form1.RUNMODAL;
MESSAGE('RESULT: %1',Comp);
SetSelskap(Selskap : Text[50])
Comp := Selskap;
MESSAGE('Value of Comp: %1',Comp);
Then I have Form, form1 whch gives a value to Selskap by calling the function Setselskap. The Message(Value of Comp: shows that the value of Comp is set correctly. and Comp is a variable in the Codeunit.
But at tyhe code( MESSAGE('RESULT',%1',Comp); THE VALUE OF Comp IS LOST
What is wrong with this code? ](*,)
I am trying to pass a parameter from a page to a codeunit function that should start an report with the given parameters in the first place. The problem is that when the parameters are passed to the codeunit, the Record looses the filters. The Variable in the Codeunit is of type "Variant".
Could anybody give a hint as to why this happends? [-o<