0 Replies Latest reply: Nov 2, 2010 4:29 AM by user9205189 RSS

    Form Rules SQL PCG

    user9205189
      Hi

      I have a client scenario in which we need to check the Header amount of a blanket PO to be compared with
      line amounts.

      If line amounts exceed header amount then an error must be thrown.

      I am trying to create a form rule SQL. for that i started with a small code just to check if we can loop in the lines block and retrieve the values of unit price.

      I am facing an issue when i go and check the results in PO form

      below is the sql code its on when-validate-record in form rule element

      l_item_price      number;
      l_curr_rec number;
      l_last_rec boolean ;
      BEGIN
      fnd_message.Clear;
      First_Record;
      l_curr_rec := name_in('SYSTEM.CURSOR_RECORD');
      l_item_price    := name_in('PO_LINES.UNIT_PRICE');
      Loop
      fnd_message.Clear;
      fnd_message.set_string(l_item_price);
      fnd_message.show;
      if name_in('SYSTEM.LAST_RECORD')= 'TRUE' then
      exit;
      else
      NEXT_RECORD;
      end if;
      end loop;
      END;

      The error says "Illegal Restricted COPY Procedure in WHEN-VALIDATE-RECORD"
      any suggestion would be of help


      Thanks