How To pass parameters between objects (forms, reports, ...)

AdministratorAdministrator Member, Moderator, Administrator Posts: 2,500
edited 2015-02-20 in How Tos section
How To pass parameters between objects (forms, reports, ...)?

http://www.mibuso.com/howtoinfo.asp?FileID=7

Discuss this How To here.

Comments

  • AnonymousAnonymous Guest Posts: 137
    Navision never explains so simply this principe : make function to pass parameters.
  • AnonymousAnonymous Guest Posts: 137
    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.
  • sveiverssveivers Member Posts: 2
    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

    What is wrong with this code? ](*,)
  • Dorian9003Dorian9003 Member Posts: 1
    Hello to you all!!

    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<
  • geordiegeordie Member Posts: 655
    For keeping the filters you need to pass the parameter by reference, ticking the "Var" field in the parameter list of your function.
Sign In or Register to comment.