Wednesday, August 5, 2015

Order is not eligible for booking. Check workflow status for this order.

If Sales Order is not able to book and if you see below Error

Order is not eligible for booking. Check workflow status for this order.

Then execute below script the order can be booked

DECLARE
   v_headerid   NUMBER;

   CURSOR cr
   IS
      SELECT oeh.header_id
        FROM oe_order_headers_all oeh
       WHERE oeh.order_number = '791137';                        --order in issue

   l_org_id     NUMBER := 204;                                        --OU ID get org id form above
BEGIN
   mo_global.set_policy_context ('S', l_org_id);

   FOR rs IN cr
   LOOP
      v_headerid := rs.header_id;
      apps.wf_engine.startprocess ('OEOH', TO_CHAR (v_headerid));
   END LOOP;
END;