Incent Validate Orders

The INCENT VALIDATE ORDERS command runs standard data validations against all rows and batches in the staging.order_item and staging.order_item_assignment tables. Use the command to validate staged orders before calling INCENT UPLOAD ORDERS to move sales order data from staging into Incent.

Syntax

incent [synchronous] validate orders;

Parameters

Parameter
Description
synchronous
(Optional) The validate command runs asynchronously by default when invoked, i.e. control returns immediately to the calling program and the job runs in the background on the Connect server. Use the ‘synchronous’ keyword to force the Connect server to return control only after the validate completes.

When invoked asynchronously, you can track the status of the validate by querying the SHOW INVOCATIONS command. Xactly recommends running large data sets asynchronously to avoid client query timeouts.

Details

The incent validate orders command performs the validations listed in the second table below against rows in the staging.order_item and staging.order_item_assignment tables. The command writes error messages tostaging.order_item_validation_error.

Ensure you have registered a valid Incent username and password within Connect before invoking the validate command. INCENT commands require valid credentials to run. Refer to INCENT CREDENTIAL.

 

The INCENT UPLOAD ORDERS command will not transfer any rows from staging tables into Incent if a single row has failed validation. Xactly recommends deleting or archiving any staging rows that failed validation prior to running the upload into Incent.

 

screen-shot-2016-10-20-at-1-17-52-pm

screen-shot-2016-10-20-at-1-17-59-pm

Connect’s data validations ensure your staging data meet’s Incent’s referential integrity requirements. You may write custom data validations to perform business logic checks using Connect’s xSQL, PIPELINE, and STEP features. Xactly recommends calling any custom validations after invoking INCENT VALIDATE ORDERS. You may write error output to the staging.order_item_validation_error table or create a custom table in the delta schema. Email a CSV error report to business users with CREATE EMAIL and WriteFile().

 

 

staging.order_item_validation_error – The upload command writes any errors encountered during validation to this table. incent upload orders truncates this table automatically for each run. Archive any existing error rows as needed before running the command.
Column Name Data Type Description
validation_id decimal Unique identifier for the error validation row.
order_code string Refer to staging.order_item
item_code string Refer to staging.order_item
error_id decimal Numeric error code.
error_message string Text description of the error.
error_field_name string Refer to staging.order_item
error_field_value string Depends on your data. Shows the data value present in the erorr_field_name from you staging table data.
created_timestamp instant Instant the row was created (UTC).

 

 

Validation Error Messages – Validation writes these error messages to the staging.order_item_validation_error table. The validate command deletes all rows at the start of each run. Archive your historical errors as dictated by business requirements.
Error Id Error Message How to Resolve
9000

exception: system exception message 

An un-handled error occurred. Troubleshoot on a case-by-case basis. Contact Xactly Tech Support if necessary.
9010 staging.order_item.batch_name must be valid The staging.order_item.batch_name does not exist in Incent. First execute INCENT CREATE BATCHES to add new staging table batches to Incent. Next, rerunINCENT VALIDATE ORDERS. Query xactly.xc_user_batch to see the list of batches available in Incent.
9011

staging.order_item.period_name must be valid

or

staging.order_item.period_name must be of type ‘MONTHLY’

Set staging.order_item.period_name to a valid monthly period in xactly.xc_period.name.

Hint: Use the LookupPeriodName() function to lookup monthly period names for a given date value.

9012

staging.order_item_assignment.employee_id must be valid

The given employee_id was not found in Incent. Set staging.order_item_assignment.employee_id to a value found inxactly.xc_participant.employee_id.
9013

staging.order_item.customer_name must be valid

The staging.order_item.customer_name does not exist in xactly.xc_customer.name. Refer to INCENT UPLOAD CUSTOMERS to load customer/account information into Incent.
9014

staging.order_item.product_name must be valid

The staging.order_item.product_name does not exist in xactly.xc_product.name. Refer to INCENT UPLOAD PRODUCTS to load information about products into Incent.
9015

staging.order_item.geography_name must be valid

The staging.order_item.geography_name does not exist in xactly.xc_geography.name. Refer to INCENT UPLOAD GEOGRAPHIES to load information about sales geographies into Incent.
9016 staging.order_item.incentive_date must fall into a valid period The staging.order_item.incentive_date does not fall within xactly.xc_period.start_date and xactly.xc_period.end_date values for a monthly period.
9018

staging.order_item.amount_unit_type_name must be valid

or

staging.order_item.amount_unit_type_name cannot be null

or

staging.order_item.[custom_field_unit_type_name]must be valid

Set the appropriate staging.order_item.*_unit_type_name to a valid value from xactly.xc_unit_type.name.
9019

staging.order_item.order_type_name must be valid

Set staging.order_item.order_type_name to null or a valid value found in xactly.xc_order_type.name.
9020

staging.order_item.amount cannot be null

Set staging.order_item.amount to a numeric value (positive and negative values and zero are valid).
9021 staging.order_item.batch_type_name must be valid Set staging.order_item.batch_type_name to null or a valid value found in xactly.xc_batch_type.name. If a null value is used, the INCENT UPLOAD ORDERScommand will use the default batch type name value, “Commissionable Events”.
9040 staging.order_item.batch_name cannot be null Enter a non-null string value into staging.order_item_batch_name. Each distinct batch name is registered with Incent in the xactly.xc_user_batch table (refer to INCENT CREATE BATCHES).
9041

staging.order_item.order_code cannot be null

or

staging.order_item_assignment.order_code cannot be null

order_code cannot be null in either staging table.
9042

staging.order_item.item_code cannot be null

or

staging.order_item_assignment.item_code cannot be null

item_code cannot be null in either staging table.
9043

staging.order_item_assignment.employee_id cannot be null

Set staging.order_item_assignment.employee_id to a value found in xactly.xc_participant.employee_id.
9044

staging.order_item.incentive_date cannot be null

Incentive date determines the calendar period in which a sales order will be processed.
9046
9070

staging.order_item_assignment.order_code/item_codedoes not exist in staging.order_item

A row in staging.order_item_assignment does not correspond to a row in staging.order_item (join between tables using order_code and item_code).
9071

staging.order_item.order_code/item_code is duplicated in staging.order_item

or

staging.order_item_assignment is duplicated instaging.order_item_assignment

Error code 9071 covers two different scenarios:

  1. The same order_code and item_code appears more than once in staging.order_item.
  2. The same employee_id has been assigned to the same order_code and item_code more than once in staging.order_item_assignment.

In either case, delete the duplicate rows to pass validation.

9072

staging.order_item_assignment.order_code/item_codedoes not exist in staging.order_item

A row in staging.order_item_assignment does not correspond to a row in staging.order_item (join between tables using order_code and item_code).

 

Examples

incent validate orders;

screen-shot-2016-10-20-at-1-14-25-pm

select invocation_id, state, status, created_instant, completed_instant, command, description
from (show invocation details)
where invocation_id = ‘2c909418560ac25901564cd8879e0e42’;

screen-shot-2016-10-20-at-1-14-19-pm

 

Related Commands

INCENT CREATE BATCHES

INCENT CREDENTIAL

INCENT UPLOAD ORDERS 

INCENT PURGE ORDERS

SHOW INVOCATIONS