Custom scheduled scripts allow to automate purchasing of new items and sending durable items to external service vendor. Running a script checks quantity of items in stock against defined rule and if the quantity is bellow target of the rule, it will then trigger purchase or service flow by adding required quantity of items to orders and/or transfer lists.
In comparison with classic purchase and service scripts, custom scripts offer more flexibility in defining the rule, items involved by the script and time when the script will be automatically started.
To setup a custom scheduled script, navigate to Order lists -> Scheduled scripts, select to create new and select Custom purchase script or Custom service script from list of available script types.
Each custom script is defined by following parts:
- rule,
- filters,
- scheduler,
- order settings.
Rule
Script rule defines behavior of a custom script and can be set on Script overview tab of script detail – it specifies when purchase or service should be triggered and in case of purchase it also defines how many units of an item should be obtained. Rule is different for scripts to obtain new items (purchase scripts) and scripts to send items to service (service scripts). Script type, purchase or service, must be selected when new custom script is created and cannot be changed afterwards.
The rule is defined by a sentence consisting from three parts:
- When part – defines what quantity is considered by the script,
- is part – defines what is threshold for the quantity coming from When part to trigger purchase or service,
- then part – defines what will happen (how many items to be ordered) if purchase or service is triggered by the is part.
Purchase script rule
Following options are available for purchase script rule to define rule to obtain new items (by purchase of new or transfer from satellite).
When
quantity in device (with items in suggested and active orders and lists) – Considers all items currently located in device (regardless of location rule), number of items in suggested purchase orders targeting the device, number of items from active purchase orders pending to be restocked, number of items from service orders and service lists which were picked for service pending to be restocked and quantity in transfer lists targeting this device.
This option is always active.
excluding used and refurbished items – when active, it deducts number of durable items which are located in device in locations of rule Used and Refurbished.
including picked durable items of any condition – when active, it adds number of durable items currently in production (picked items not yet returned to device). Picked items of any condition are added (regardless if new, used, refurbished or service needed).
excluding durable items needing service – when active, it deducts number of durable items located in locations of rule For service and serialized durable item instances which were locked for service and are currently on other locations than the ones with rule For service. Further on it will deduct number of items currently picked for service orders and service lists which has not been restocked (or scrapped) yet.
considering transfer demand – when active and script runs for a device of central stock, it will check if quantity of all items required from this stock by transfer lists can be fully covered by quantity which is or will be available in all devices of the central stock. If not, it will request missing quantity on random device of the central stock having requested item(s) assigned by deducting the quantity demanded by transfer lists.
For more information about the option see considering transfer demands in classic scripts.
consider pick list demands – when active, script will check if quantity of items required by predefined pick lists targeting this device can be fully covered by quantity which is or will be available in the device. If not, it will request demanded quantity by deducting it.
For more information about the option see considering pick list demands in classic scripts.
is
below maximum quantity – triggers purchase when quantity calculated in When clause is lower that Maximum quantity defined by item-device assignment.
at or below order point – triggers purchase when quantity calculated in When clause is at or below Order point quantity defined by item-device assignment.
below minimum quantity – triggers purchase when quantity calculated in When clause is below Minimum quantity defined by item-device assignment.
Minimum quantity can be specified for durable items only. For consumable items it is always 0.
out of stock – triggers purchase when quantity calculated in When clause is 0.
then
order up to maximum quantity – when script is triggered, additional quantity ordered (or added to transfer list) will be calculated as Maximum quantity defined by item-device assignment minus quantity calculated in When clause.
order up to order point – when script is triggered, additional quantity ordered (or added to transfer list) will be calculated as Order point quantity defined by item-device assignment minus quantity calculated in When clause.
order up to minimum quantity – when script is triggered, additional quantity ordered (or added to transfer list) will be calculated as Minimum quantity defined by item-device assignment minus quantity calculated in When clause.
Minimum quantity can be specified for durable items only. For consumable items it is always 0.
Purchase package quantity is always reflected by script when items are added to purchase orders. Item is not added to order if whole package cannot fit the requested quantity. When item is requested from central stock by adding it to transfer list, purchase package quantity is not reflected and script reflects its dispense package quantity instead.
Service script rule
There is only single option available for service script rule – it is possible to define how many items needing service should be in each device before all of these are sent to service.
Service script considers only items with external service vendor. Items with internal service vendor are added to service lists automatically once they are returned to device.
Quantity of When clause is calculated as number of items in a device which are currently in locations of rule For service, serialized durable item instances which were locked for service and are currently on other locations than the ones with rule For service and number of items in active service orders which are waiting to be picked for service.
Items having minimum quantity for service set on their service settings will not be counted if their minimum quantity for service is not reached.
Is allows to define minimum quantity which is needed before all items needing service from the device will be placed to service order(s).
Quantity added to service orders when the is clause is fulfilled is then determined as quantity from When clause minus quantity already placed in new or suggested service orders.
Filters
Filters allow to limit items which will be involved during run of a script. Items not fitting the filters will not be ordered by a script and will be ignored by the script’s rule. Filters can be set on Script overview tab of script detail.
Filters can be set based on several item information. Leaving the filter empty will not apply any limitation. Selecting specific value for a filter will limit all items, which are not fitting selected value(s).
While multiple filters are specified, only items fitting all selected values will be considered by the script.
Scheduler
Scheduler allows to specify when a script will run. It can be set on Script overview tab of script detail. It is possible to define single time and date in the future or set the script to be started periodically. Following options are available for scheduler:
- Once – script will start in given date and time. Once finished, it will not start automatically again.
- Each fifteen minutes – script will start four times per hour, in 0, 15, 30 and 45 minutes of each hour.
- Each thirty minutes – script will start twice per hour, in 0 and 30 minutes of each hour.
- Hourly – script will start each hour in given time specified by minutes.
- Twice per day – script will start twice per day, with first run specified by time and second run calculated as specified time + 12 hours.
- Four times per day – script will start four times per day, with first run specified by time and consequent three runs in specified time + 6, 12 and 18 hours.
- Daily – script will start each day in specified time.
- Weekly – script will start each week in specified days of the week and specified time.
- Monthly – script will start each month in specified day of the month and specified time.
Script must be set as Active in order to let the scheduler run.
Running the script manually by Run script option in toolbar will not impact the scheduler and planned runs.
Start date and End date can be set to limit time frame when the scheduler will be started. When set, script will not be automatically started outside of this time frame. These dates can be left empty not to limit the script.
Order settings
Tab Order settings contain options defining how the script will create new orders.
These options will not affect script running for satellite devices and ordering items via transfer lists.
Following options are available.
Option name | Functionality |
Create order for stock/vendor combination | If this option is selected, all orders created by this script will be created on stock level (one order will contain more devices of one stock) and vendor. If left blank, separate orders will be created for each device and vendor. |
Create order as ”Suggested” | If option is selected, all orders created by this script will be set to state ”Suggested”. To send this order to vendor, user must manually change status to ”Active”. If left blank, script will automatically set order to ”Active” state and send it to vendor based on selected options (if minimum order value is reached or maximum order value is not exceeded as set on vendor, otherwise order is set to ”Suggested” state). |
Custom order ID prefix | Specifies if orders created by this script will have custom order ID prefix instead of Default order ID prefix set on vendor detail. |
Custom Ship to ID | Specifies if orders created by this script will have custom Ship to ID information instead of default Ship to ID set on vendor detail. |
Custom Customer number | Specifies if orders created by this script will have custom Customer number information instead of default Customer number set on vendor detail. |
Send options
Send options section specifies channels and formats in which orders created by the script will be sent to vendor. Orders created by this script will then carry the same sending options as specified on the script.