Search code examples
oracleformsoracle-ebs

Oracle Forms Execute_query giving FRM-40737 error


I am getting an error

FRM - 40737 - illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-RECORD trigger.

My Code is

IF event_name = 'WHEN-VALIDATE-RECORD'
      THEN
         IF (form_name = 'OEXOEORD' AND block_name = 'ORDER')
         THEN
            -- call procedure to validate and cascade the ship method code.
            cascade_ship_method;
         execute_query;
         END IF;

What am I doing wrong here ?


Solution

  • This is because Oracle Forms has two types of built-in procedures - restricted and unrestricted. Some triggers enable restricted procedures, some not (see Oracle Forms help, every trigger has information which procedures it enables).

    Trigger WHEN-VALIDATE-ITEM fires for example when user moves cursor from one record to the other (this is called navigation). In this case it leaves one record and enters other. There is fired following chain of triggers

    • WHEN-VALIDATE-ITEM
    • WHEN-VALIDATE-RECORD
    • POST-ITEM
    • POST-RECORD
    • PRE-RECORD
    • PRE-ITEM

    If any of this trigger fails, navigation is canceled and cursor returns to the original item. If you call any procedure, which starts new navigation (like GO_BLOCK), Oracle Forms would not be able to manage first navigation.

    This is, why some procedures are restricted.