call to procedure from form

krasi_varna_77krasi_varna_77 Member Posts: 34
I have a form with my procedure. In table Users I have a field with Integer number of form. that are forms which defined what is user must run. how I can call this procdure when I have only form ID.

Comments

  • WaldoWaldo Member Posts: 3,412
    You want something like "late binding", don't you?

    Again, man, sorry, not possible :(.

    You should always make a variable if you want to run a function within your form.

    You could be writing a huge CASE-statement, but I guess this is not something you want. :-k

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    edited 2007-10-08
    Hi All

    Waldo, you don't right!!! It's possible!!!

    Command for run a forms:
    strURL := strsubstno('navision://client/run?target=Form %1',FormID); // other parameters get from zup file
    HYPERLINK(strURL + '&variable=hello');

    On the forms need changed OnHyperlink trigger:
    Form - OnHyperlink(URL : Text[1024])
    variable := DELSTR(URL,1,STRPOS(URL,'variable')+STRLEN('variable'));
    MESSAGE(variable);
  • WaldoWaldo Member Posts: 3,412
    Hm, OK.

    In this case, you only opened a form and filled in a variable with a value ... and you had to add code on that form. You could have don that with a singleinstance codeunit as well... :whistle: .

    For me, the question was to run any function in any form without writing a single line of code on the form itself... . If writing code on the form is allowed ... OK, many solutions are possible ... :-k

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • krasi_varna_77krasi_varna_77 Member Posts: 34
    I use one CASE structure and decided task
  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    Hi All

    No don't need a singleinstance codeunit - this work without it. Just run forms via hyperlink.

    I understood need run some function on forms - so modified forms need in any case.
  • WaldoWaldo Member Posts: 3,412
    I understood need run some function on forms - so modified forms need in any case.

    I agree.

    And then it's just up to him to decide WHERE he wants to customize. I would centralize the code in one place and use the CASE-statement to decide which form-variable I have to call ... .

    In you case, the singleinstance isn't needed, that's true. In my case, the URL/Hyperlink isn't needed. Just two solutions with the same outcome.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • Yaroslav_GaponovYaroslav_Gaponov Member Posts: 158
    Yes, just two solutions with the same outcome. :lol:

    ...but I know in NAV5 the URL's have a wide distribution \:D/
Sign In or Register to comment.