Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tRunJob: Transmit context to subjob

I have a problem with passing context to subjobs. In a controlling job I use tRunJob to call a subjob with "Transmit whole context" activated. I created a context in the controlling job.In the child job, I have done nothing to load the context. When I run the controlling job, the child job which uses a variable from the context reports that the context variable "cannot be resolved or is not a field". Are my settings wrong? I expected that activating "Transmit whole context" in the controlling job would be sufficient?
See my settings in the attached job.
0683p000009MDgd.png 0683p000009MDkc.png 0683p000009MDkh.png 0683p000009MDcF.png 0683p000009MDjk.png
Labels (2)
5 Replies
Anonymous
Not applicable
Author

You need to have the variable myContextVar defined in both jobs parent and child.
Only the values are transferred to the child job based on the context name match.
Anonymous
Not applicable
Author

Hi
The effective range of a context variable is limited to the job itself, the child job can't access the context variables of the main job. You need also to define a variable with the same name in child job. If the 'transmit the whole context' box is checked, the value of context variables of the main job will be passed automatically to the context variables with the same name of the child job.
Shong
Anonymous
Not applicable
Author

Hi Lubod,
Many times creating context variables is tiresome... We can also think of using routine which can be called anywhere in the project. Create simple getter setter routine to get and set the values of respective variables across the project.
Vaibhav
Anonymous
Not applicable
Author

hi all,
Dont use getter & setter java function 0683p000009MA9p.png
It's a good way to create some Context Group in Metadata classified "as you want".
The goal is to be able ti use contexte variable when you need it & drag & drop from context group to your job.
Veray easy to create and maintain as anything from repository( metadata).
hope it helps
regards
laurent
mamohan
Contributor
Contributor

Hi,

If i have the context variable defined with a default value in context groups and use it in trunjob as well as called job. While executing, i am changing the default value in the main job and it is not getting passed in the called job. Will it get overridden by the default value set in context group while the called job start execution?