IBM Support

createChainedOrder leads to the error Record already exists in the database

Troubleshooting


Problem

Attempts to run createChainedOrder in IBM Selling and Fulfillment Suite leads to the error Record already exists in the database.

Symptom

Steps to reproduce:

  1. Create a bundle Item and two child items.

  2. Keep the shipnode as Drop ship type for the child item. Individual child item for the bundle parent should be sourced from different drop ship nodes.

  3. Create a sales order with Bundle item.

  4. Schedule and Release the order. The order moves to Awaiting Chained Order status.

  5. Run createChainedOrder to create Purchase Order for the sales Order. The below error is seen in the log file:

    ErrorCode="YFC0001" ErrorDescription="Record already exists in the database."
    ....
    ErrorCode="java.sql.SQLIntegrityConstraintViolationException" ErrorDescription="" ErrorRelatedMoreInfo="ORA-00001: unique constraint (SSFS94.YFS_ORDER_LINE_SCHEDULE_I1) violated

Cause

This is working as designed.

Diagnosing The Problem

Consider an order with one parent line and two child lines

SalesParent1
SalesChild1
SalesChild2

Now when create chained order runs, it tries to create two chained orders.

ChainedOrder1 with
POParent1
POChild1

ChainedOrder2 with
POParent1
POChild2

Now Sterling is trying to reuse the same orderlinekey it generated while creating ChainedOrder1 into ChainedOrder2 as well. This is resulting in the unique constraint violation observed and the whole transaction rolls back.

Resolving The Problem

Workaround:

  1. Implement BeforeCreateOrderUE and remove the bundle parent from input
    xml.

    <BundleParentLine OrderLineKey="" PrimeLineNo="" SubLineNo=""
    TransactionalLineId=""/>



    The enhancement request 43337 has been raised to source child components from difference vendors.

[{"Product":{"code":"SS6PEW","label":"Sterling Order Management"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Documentation","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.4","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
11 February 2020

UID

swg21992879