Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

GO_BLOCK('BLOCK_NAME') does not take me to BLOCK_NAME canvas.

Andy CSep 16 2021

Hi Expert,
My form has couple of data blocks. may be the following would better explain :
DATA BLOCKS:
BLOCK4 (CANVAS2)
--create the text item (text_item1....text_item7)
--create list item (View, Create, Delete)
B_ACTION (CANVAS2)
--button creation (Such as: Search, View, Create, Delete and Close)

B_ACTION_RESULT (CANVAS51)
--create button

CMX_OFIN_LOC_MAPPING (CANVAS51)
--query data source name (DB_table_name)
--Scroll bar CANVAS (CANVAS51)
--create the text item

CANVAS:
CANVAS2 (Main page -> PAGE 1)
CANVAS51 (Search forms -> PAGE 2)

WINDOWS:
WINDOW1(PAGE 1)
WINDOW2(PAGE 2)
The order of the blocks, canvases and windows are same as shown above.

When form loads (CANVAS2), the text item (Data block:BLOCK4) will get values. Then, click "Search" button (CANVAS2 and data block: B_ACTION). The CANVAS51 is shown and CANVAS2 (text item) value will pass to CANVAS51. Then, display the result in (text item and data block: CMX_OFIN_LOC_MAPPING)

I expect to go to Go_Block and Go_Item to show the CANVAS51 but nothing happens. May I know any function is missing?
Thanks,
Andy

-------------------------------------------------------------------------------------------------------
Here to attached my coding:
CANVAS2 (Button: Search Event: WHEN-BUTTON-PRESSED)
BEGIN
IF :BLOCK4.LIST_ITEM_NAME = 'View' THEN
P_SEARCH;
ELSIF :BLOCK4.LIST_ITEM_NAME IN('CREATE', 'DELETE', 'UPDATE') THEN
P_CALL_FORM(NULL);
END IF ;

EXCEPTION
when FORM_TRIGGER_FAILURE then
raise;
when OTHERS then
emessage(SQLERRM);
raise FORM_TRIGGER_FAILURE;
END;

Program Unit (P_SEARCH)
PROCEDURE P_SEARCH IS
BEGIN
Go_Block('CMX_OFIN_LOC_MAPPING');
Clear_Block(No_Validate);
P_SET_WHERE_CLAUSE;
Execute_Query
IF :system.current_block = 'CMX_OFIN_LOC_MAPPING' THEN
IF :CMX_OFIN_LOC_MAPPING.COMPANY IS NULL THEN
wmessage('NO_REC');
Go_Block('B_ACTION');
Go_Item('B_ACTION.PB_SEARCH');
Hide_Window('WINDOW2');
RAISE FORM_TRIGGER_FAILURE;
END IF;
END IF;
if FORM_SUCCESS then
Set_Block_Property('CMX_OFIN_LOC_MAPPING', INSERT_ALLOWED, PROPERTY_FALSE);
Execute_Trigger('WHEN-NEW-RECORD-INSTANCE');
end if;

HIDE_VIEW('WINDOW1');
Go_Item('B_ACTION_RESULT.PB_BACK');
END;

Program Unit (P_SET_WHERE_CLAUSE)

PROCEDURE P_SET_WHERE_CLAUSE IS
l_where VARCHAR2(2000);
BEGIN
l_where := 'where 1 = 1 ';

IF :BLOCK4.COMPANY_CODE IS NOT NULL THEN
l_where := l_where || ' and company = ' || ':BLOCK4.COMPANY_CODE';
END IF;

IF :BLOCK4.NEO_LOC IS NOT NULL THEN
l_where := l_where || ' and NEO_LOC = ' || :BLOCK4.NEO_LOC;
END IF;

IF :BLOCK4.OFIN_LOC IS NOT NULL THEN
l_where := l_where || ' and OFIN_LOC = ' || :BLOCK4.OFIN_LOC;
END IF;

IF :BLOCK4.OFIN_COMP IS NOT NULL THEN
l_where := l_where || ' and OFIN_COMP = ' || :BLOCK4.OFIN_COMP;
END IF;

IF :BLOCK4.OCC IS NOT NULL THEN
l_where := l_where || ' and OCC = ' || :BLOCK4.OCC;
END IF;

IF :BLOCK4.SEGMENT12_MAP IS NOT NULL THEN
l_where := l_where || ' and SEGMENT12 = ' || :BLOCK4.SEGMENT12_MAP;
END IF;

IF :BLOCK4.BRAND_CODE IS NOT NULL THEN
l_where := l_where || ' and BRAND_CODE_IN = ' || :BLOCK4.BRAND_CODE;
END IF;

Set_Block_Property('CMX_OFIN_LOC_MAPPING', DEFAULT_WHERE, l_where);

EXCEPTION
WHEN FORM_TRIGGER_FAILURE THEN
RAISE;
WHEN OTHERS THEN
emessage(SQLERRM);
RAISE FORM_TRIGGER_FAILURE;
END;

Comments
Post Details
Added on Sep 16 2021
3 comments
2,092 views