Skip to main content

We have a export sourcing setup where once customer orders are placed for external customer based on the sourcing of item/primary supplier from other site corresponding internal PO/CO are generated.

In order to have visibility of the internal CO generated at the source customer order level we are trying to call the supply_order_analysis_api.generate_tree procedure from an event action. 

 

However the procedure is only generating the first 2 nodes of the tree Parent Customer Order and Internal Purchase Order. It is not creating the last node Internal Customer Order.

Hi @snawaz77 ,

 

I do not understand the requirement of executing the given procedure in a event.  When you use the above method that will delete the existing tree id and create a new tree id. Therefore be couscous when doing that.  I have tried running the procedure for below example.

The data in the table is in below tree format.

 

When you run the method with correct parameters that will create a new tree id.

Then you will see the old tree id is no longer there and instead the new tree is there with all the nodes.

All nodes are correctly created and can be viewed in the application.

 

You may use the test window in pl sql to test this. Please check whether you are passing the correct parameters for order_ref1,order_ref2,order_ref3,order_ref4 and source_type.


For us even if we run the script through PL/SQL developer it generates all nodes successfully however above screenshot is when the procedure is called from custom event action and in that case only first 2 nodes are generated the 3rd line for internal customer order is not being generated.


 


Hi @snawaz77 ,

 

As I can see you are invoking the tree generation procedure at the ORDER_RELEASED event action. I believe that supply_order_analysis_api.generate_tree logic executed before creating the other internal customer order. Please check a relevant event action to create the internal order. I suggest to check the order status check to - Delivered.  If that is not successful then you may extend the logic to check whether internal customer order is created