This topic describes how to run PANTHEON's Refresh Stock function using
SQL Server jobs.
In Enterprise Manager, find and expand the desired SQL Server, go to Management,
SQL Server Agent, right-click Jobs and select New Job...

Enter the job Name, but don't change the Category. The
Description is optional. Click the Steps tab.

Here you define steps that should be exsecuted. Click New to add a
new step.

Step 1 - Refresh Serial Numbers
Step name |
The name of the step. As this one will refresh
serial numbers, name it Refresh serial numbers. |
Type |
Use TSQL, the default. |
Database |
Select the database on which you want to run
the job. This example uses NovoPodjetje. |
Command |
Enter SQL commands that should be executed, in this case two
stored procedures.
exec pPA_SerialNoItemRecalc '', null, null
exec pPA_SerialNoStatusRecalc ''
|
Click OK to save the step.

 |
Learn more about stored procedures in PANTHEON's
database at Datalab's
Developer Site
under Database Info |DB Info P55 | Procedures, Views, Triggers. |
Step 2 - Refresh Prices
Again click New... to add another step.
Step name |
The name of the step. This one
will Refresh prices. |
Type |
Use TSQL, the default. |
DataBase |
Select the database on which you want to run
the job. This example uses NovoPodjetje. |
Command |
Enter SQL commands that should be executed, in this case
three
stored procedures.
exec pPA_PriceCalc '', null, null, ''
exec pPA_PriceCalcOwnPrice '', null, null, ''
exec pPA_MoveAssmblyRecalc ''
|
Click OK to save the step.

Step 3 - Refresh Stock
Again click New... to add another step.
Step name |
The name of the step. This one
will Refresh stock. |
Type |
Use TSQL, the default. |
DataBase |
Select the database on which you want to run
the job. This example uses NovoPodjetje. |
Command |
Enter SQL commands that should be executed, in this case
a
stored procedure.
exec pPA_StockRecalc ''
|
Click OK to save the step.

4. korak preračuna - Preračunaj glave dokumentov
Ponovno kliknemo New za kreiranje novega koraka. Tu vpišemo:
Step name |
The name of the step. This one
will Refresh document headers.. |
Type |
Use TSQL, the default. |
DataBase |
Select the database on which you want to run
the job. This example uses NovoPodjetje. |
Command |
Enter SQL commands that should be executed, in this case
a
number of stored procedures.
exec pPA_CashRegRecalc null, null
exec pPA_GLRecalc null, null
exec pPA_OrderHeadRecalc null, null
exec pPA_OrderDispDocRecalc '', null, null
exec pPA_MoveHeadRecalc null, null, 'F'
|
Click OK to save the step.

Now all the necessary steps are set up. This basically does the same as
the Refresh Stock function in PANTHEON.

Setting a Schedule
Now you just have to set up a schedule for the job so you don't need to
run it manually. Go to the Schedules tab and click New
Schedule...

Type in a name for the job schedule and set the Schedule Type to
Recurring. Click Change... to set recurrence parameters.

Select that the jobs occurs Daily and Every 1 Day. Under
Daily frequency, select Occurs once at: and set the desired time
(during the night is recommended). Click OK several times to close
all dialog windows. The new job is now listed in the Jobs panel.
 |
You can schedule a job to run every couple of hours
by settings Daily frequency to Occurs every: and specifying
the time interval.
Note that running job during business hours may slow down
normal work because of the increased server load. |
