Presentation on how to Integrate the old and new Oracle technologies. Communicate from Forms to APEX and v.v.
(Demo movie at the end of the presentation)
9. Introduction APEX 3.2 : Forms conversion Thechallenge of converting Simple Forms (60%) Moderate Forms (30%) (Very) Complex Forms (10%) Top 10 % project start project finish
28. Create procedure runJavascriptRequirement : When I move through a list of Products (Oracle Form), I want to see who bought it and where the customer is located. PROCEDURE runJavascript( pScript varchar2) IS BEGIN web.show_document('javascript:'||pScript, '_self'); END; web.show_document( ‘javascript:showOnMap()’, ‘_self’);
29.
30. Create procedure TriggerApexPROCEDURE TriggerApex( pTrigger varchar2 ) IS BEGIN if name_in('system.current_form') = 'PRODUCTS' then if pTrigger = 'WHEN-NEW-RECORD-INSTANCE' then -- Requery APEX Reports region with parameter on Page 9 -- & Show the data on the Map runJavascript('refreshReport('|| name_in('PRODUCTS.PRODUCT_ID')|| ', ''P9_PRODUCT_ID'');showOnMap();'); end if; end if; END; TriggerApex('WHEN-NEW-RECORD-INSTANCE');
32. Communicate from Forms to APEX APEX PAGE APEX REGION APEX REGION web.show_document APEX Form ORACLE FORM APEX Report APEX Chart
33. Communicate from APEX to Forms Requirement : When I click on a customer in a report, I should be able to edit the customer data – using our current (very complex) Form. When I save the changes the report should be updated immediately.
41. Add code to TriggerApex procedure in library to refresh reportfunction queryCustomer( pCustId ) { //Setting Customer Id in Form and Requery execFormAction( 'execute_query', pCustId) } function execFormAction(pAction, pParam) { //Raising an event in Forms //Execute the Action (like 'execute query') $x('formsapplet').raiseEvent(pAction, pParam ); } PROCEDURE execEvent IS BeanEventDetailsParamList; ParamType number := text_parameter; Event varchar2(1000); Payload varchar2(1000); begin BeanEventDetails := get_parameter_list(name_in('system.custom_item_event_parameters')); get_parameter_attr(BeanEventDetails, 'Event', ParamType, Event); get_parameter_attr(BeanEventDetails, 'Payload', ParamType, Payload); if name_in('system.current_form') = 'CUSTOMERS' then if upper(event)='EXECUTE_QUERY' then set_block_property('DEMO_CUSTOMERS' , DEFAULT_WHERE, 'WHERE CUSTOMER_ID = '||payload ); execute_query; end if; end if; end; if pTrigger = 'POST-DATABASE-COMMIT‘ then -- Requery APEX Reports region with pValue, pField parameters runJavascript('refreshReport('''', '''')'); end if;
42. APEX REGION Communicate from APEX to Forms APEX PAGE Extended Forms Applet : raiseEvent APEX REGION APEX REGION web.show_document APEX Form CommunicatorBean / PJC ORACLE FORM APEX Report WHEN-CUSTOM-ITEM-EVENT APEX Chart PJC Library
48. Details are in Wilfred’sdoc!! if upper(event) = 'WHEN-APPLET-ACTIVATED‘ then while true loop -- get the form name set_custom_property('BLK_PJC.PJC', 1,'EvalExpression','$v("CALL_FORM_NAME")'); formName := get_custom_property('BLK_PJC.PJC', 1, 'EvalResult'); call_form(formName); appletActive := get_custom_property('BLK_PJC.PJC', 1, 'AppletActive'); if appletActive = 'FALSE‘ then exit; end if; end loop; end if;
63. login into Forms (once)http://localhost:7778/forms/frmservlet?config=apex&userid=&APP_USER./&P101_PASSWORD.@XE
64. Conclusions Thechallenge of converting Simple Forms (60%) Moderate Forms (30%) (Very) Complex Forms (10%) Top 10 % project start project finish
65. Conclusions Convert the major part at once Convert the rest when necessary/possible So reducing effort – (re)build and test money risk But you still need the Forms Server ($) Top 10 % project start project finish