If you're planning on using the Codeunit.run(<variable>) syntax then no. You cannot change the definition of the trigger (like you could in other languages).
However you should be able to define functions for you to handle setting and retrieving values from the codeunit. This is like declaring Get and Set properties.
However this means that you have to declare a global or local variable to represent the codeunit and you can't use the more generic CODEUNIT.RUN(<Codeunit Number>,<variable>) syntax.
Yes i was able to create code and get a correct return value.
But my problem is that.
No such Onpush trigger, if this button attached to the request form of a report for me able to call my function.
Ill give you some background for this purpose.
I attached a command button at the request form of the report for the user can initialized the location path where the text file tobe extracted base from the report.Because this textfile has a specific format.
There should be an OnPush trigger on every button control that you put on a form.
Why are you putting any code in a codeunit....you should be able to write fucntions in your report object that handle file manipuation and parsing or generating a file name. If you did that then you wouldn't need a codeunit.
Yes i was also wondering why theres no Onpush Trigger event to this button. I think this is because this is a request form from report not an ordinary form created at object designer.
Another thing is that i use to create the code unit because as i notice from the property of the button.It can call a code unit at "PushAction" = RunObject so i can assign RunObject = MyCodeUnit.
And i created a Global Function to this report, as you advice.With same procedure with my CodeUnit.
But i cannot called the function Onpush event to that button.
Because no such Onpush event to that button because it is attached to the request form of a report.
](*,)
Yes it does sound like you've got a license or permission error.
In the Request form designer you should be able to highlight the button, click F9 (or the CAL Code button on the menu bar) and see the Navision code and the OnPush trigger. If you cannot get to the CAL code then you probably don't have the license to modify that report or a report object.
I notice no option of right clicking the object command button.
But when i press F9. I see the code and there is an event OnPUsh()
I used to put my fuction there and it seems it really works,
Comments
However you should be able to define functions for you to handle setting and retrieving values from the codeunit. This is like declaring Get and Set properties.
However this means that you have to declare a global or local variable to represent the codeunit and you can't use the more generic CODEUNIT.RUN(<Codeunit Number>,<variable>) syntax.
Epimatic Corp.
http://www.epimatic.com
What value are you trying to get back? What are you trying to do with it?
Epimatic Corp.
http://www.epimatic.com
But my problem is that.
No such Onpush trigger, if this button attached to the request form of a report for me able to call my function.
Ill give you some background for this purpose.
I attached a command button at the request form of the report for the user can initialized the location path where the text file tobe extracted base from the report.Because this textfile has a specific format.
Why are you putting any code in a codeunit....you should be able to write fucntions in your report object that handle file manipuation and parsing or generating a file name. If you did that then you wouldn't need a codeunit.
Epimatic Corp.
http://www.epimatic.com
Another thing is that i use to create the code unit because as i notice from the property of the button.It can call a code unit at "PushAction" = RunObject so i can assign RunObject = MyCodeUnit.
And i created a Global Function to this report, as you advice.With same procedure with my CodeUnit.
But i cannot called the function Onpush event to that button.
Because no such Onpush event to that button because it is attached to the request form of a report.
](*,)
Thanks.
Do you have a full developers license? Or just report developer?
Epimatic Corp.
http://www.epimatic.com
Meaning you have the option of right clicking the command button and the onpush trigger show?
In the Request form designer you should be able to highlight the button, click F9 (or the CAL Code button on the menu bar) and see the Navision code and the OnPush trigger. If you cannot get to the CAL code then you probably don't have the license to modify that report or a report object.
Epimatic Corp.
http://www.epimatic.com
I notice no option of right clicking the object command button.
But when i press F9. I see the code and there is an event OnPUsh()
I used to put my fuction there and it seems it really works,
Thanks for your advice,
Epimatic Corp.
http://www.epimatic.com