Hello
Please, is it somehow possible to run function defined in codeunit when I only have ID of Codeunit ?
I can run codeunit by CODEUNIT.RUN(Id) ,but I do not know how to run function inside it .... it is used to run multiple different codeunits so I do not want to define them as variables.
I need to pass some variable to that codeunit so i wanted to do it by calling it's "SetVariable" function
Thank u in advance
0
Comments
So is there another way how can I solve my problem ?:
I have in Job scheduler several jobs which run the same CODEUNIT.
I have field Parameters which are different for each Job.
I would like to, in OnRun() function of codeunit to find out which Job "runned" the codeunit so I can read parameters from specific line.
Thanx
Now you can check that parameter in the OnRun-trigger of your codeunit, to execute the wanted function.
Hmm, no such tables here ... I have v5.1 tech update .. should it be here?
I have only: 5980-Job Scheduler Mgt. Setup,5981-Job Scheduler Setup,5982-Job Scheduler Log
Koubek:
I was thinking about this, but what if
a) Some codeunit is not defined with Record parameter in OnRun()
b) Some codeunit has defined different Record type as input parameter ... then I can not use the one from JScheduler
You apparently are using an older version of the Job Queue module.
I will probably try to use Koubek's solution, because all CU's which are runned by JScheduler was currently runned without any Rec parameter so I suppose tha do not have defined any "table" in Properties.
So if there is not problem with calling such CU's with parameter It can work ... I will add "table" property only to those which I will modify to use it ....
If so, of course, it will be defined there, but I probably do not understand what u meant by triggering CU from another CU (I mean to solve my problem)
If there is no other way to pass JOB_ID directly to CU ,only by Record param I see only way to store it somewhere and then find it ... but it is not "bulletproof" because I am not able to generate some unique identifier which will be known to both CUs
(Maybe it will work in 99% nut not 100% :-) )
I have
CU1(JSchRec):
CODEUNIT.RUN(JSchRec.Codeunit_ID);
CU2():
OnRun():