Hi All,
Today we will discuss about the Parameter String Field in Navision Job Queue Entry Page / Form. The Functionality is still same, so the steps below can be replicated and used in NAV Classic also. For Demo Purpose We will be using NAV 2013 R2.
Why we need to have a Parameter?
Consider a Scenario where you want to does multiple things with a single objects in NAS based on parameter you pass. Example - There should be different action on the sales Header Table based on Parameter that I Pass.
So Let's see how to use the Parameter String in Job Queue.
For the Demo, I have created the Job Queue & Job Queue Category List as DEMO.
Now for Demo, I am creating two Tables Demo Customers and Demo Items. The Job Queue will insert Record in these tables based on the parameter that I pass.
The Important Thing to Remember about Parameter String to be used with Job Queue is -
"The Object Should be Running with the Record of Job Queue Entry Table."
We Will be using a Codeunit for the Demo, Go to Properties of OnRun Trigger and Enter the TableNo as 472.
Let's now write condition for the parameter that will be passed by Job Queue. We will be using two functions for creating dummy customer and dummy items based on parameter passed. These functions will be called based on Parameter String Passed.
As Shown below we are done with conditionally executing code based on parameter passed by user.
Let's set-up the Job Queue Entries for Both the Cases as shown below -
IF you see above except the Parameter String, everything else remain Same. So when the first (left) Job is executed an Customer is created and When Second (Right) Job is executed an Item is created.
Let's try to Execute the Job With Item First and see the Results -
Now Let's try to run the Job having Cust as Parameter -
Think of the situation where you can use it. Like Running Batches with Filters.
Hope you find the post useful.
Today we will discuss about the Parameter String Field in Navision Job Queue Entry Page / Form. The Functionality is still same, so the steps below can be replicated and used in NAV Classic also. For Demo Purpose We will be using NAV 2013 R2.
Why we need to have a Parameter?
Consider a Scenario where you want to does multiple things with a single objects in NAS based on parameter you pass. Example - There should be different action on the sales Header Table based on Parameter that I Pass.
So Let's see how to use the Parameter String in Job Queue.
For the Demo, I have created the Job Queue & Job Queue Category List as DEMO.
Now for Demo, I am creating two Tables Demo Customers and Demo Items. The Job Queue will insert Record in these tables based on the parameter that I pass.
The Important Thing to Remember about Parameter String to be used with Job Queue is -
"The Object Should be Running with the Record of Job Queue Entry Table."
We Will be using a Codeunit for the Demo, Go to Properties of OnRun Trigger and Enter the TableNo as 472.
Let's now write condition for the parameter that will be passed by Job Queue. We will be using two functions for creating dummy customer and dummy items based on parameter passed. These functions will be called based on Parameter String Passed.
As Shown below we are done with conditionally executing code based on parameter passed by user.
Let's set-up the Job Queue Entries for Both the Cases as shown below -
IF you see above except the Parameter String, everything else remain Same. So when the first (left) Job is executed an Customer is created and When Second (Right) Job is executed an Item is created.
Let's try to Execute the Job With Item First and see the Results -
Now Let's try to run the Job having Cust as Parameter -
Think of the situation where you can use it. Like Running Batches with Filters.
Hope you find the post useful.
Your Questions and Comments are awaited.
Regards,
Saurav Dhyani