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.
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);
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
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.
Comments
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
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);
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
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.
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
...but I know in NAV5 the URL's have a wide distribution \:D/