Does anyone have an example of creating a task in Custom Event using PL/SQL? I will be grateful!
Page 1 / 1
If you have any events in your client already, you should be able to export one of these - to an application configuration package - and this will give you an example to work from.
Or you can RMB on the event header and choose export custom event.
this creates a .ins file similar to the one below:
-------------------------------------------------------------------------------------------- -- Export file for Custom Events BAT_BAL_DATE_ALIGN.-- -- Date Sign History-- ------ ------ ------------------------------------------------------------- 230125 IFSAPP Export file for task BAT_BAL_DATE_ALIGN.-------------------------------------------------------------------------------------------- SET DEFINE ~PROMPT Register Custom Event "BAT_BAL_DATE_ALIGN"DECLARE event_lu_name_ VARCHAR2(30) := 'ShopOrd'; event_id_ VARCHAR2(30) := Database_SYS.Unistr('BAT_BAL_DATE_ALIGN'); id_ VARCHAR2(100); info_msg_ VARCHAR2(32000) := NULL;BEGIN-- Construct Main Message info_msg_ := Message_SYS.Construct(''); Message_SYS.Add_Attribute(info_msg_, 'EVENT_DESCRIPTION', Database_SYS.Unistr('Need date is changed on a Batch balanced Shop Order')); Message_SYS.Add_Attribute(info_msg_, 'EVENT_ENABLE', 'FALSE'); Message_SYS.Add_Attribute(info_msg_, 'EVENT_TYPE_DB', 'CUSTOM'); Message_SYS.Add_Attribute(info_msg_, 'EVENT_TABLE_NAME', 'SHOP_ORD_TAB'); Message_SYS.Add_Attribute(info_msg_, 'EVENT_TRIGGER_TYPE_DB', 'BEFORE'); Message_SYS.Add_Attribute(info_msg_, 'MODIFIED_ATTRIBUTES', 'NEED_DATE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_ROW_DB', 'FALSE'); Message_SYS.Add_Attribute(info_msg_, 'MODIFY_ROW_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'REMOVE_ROW_DB', 'FALSE');-- Register Custom Event Fnd_Event_API.Register_Custom_Event(event_lu_name_, event_id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('BALANCE_ID'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'NUMBER'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'FALSE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('NEED_DATE'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'DATE'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('ORDER_NO'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'STRING'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('RELEASE_NO'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'STRING'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('ROWSTATE'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'STRING'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Register Event Parameter info_msg_ := Message_SYS.Construct(''); id_ := Database_SYS.Unistr('SOURCE'); Message_SYS.Add_Attribute(info_msg_, 'ID_TYPE', 'STRING'); Message_SYS.Add_Attribute(info_msg_, 'PLSQL_METHOD', Database_SYS.Unistr('')); Message_SYS.Add_Attribute(info_msg_, 'CURRENT_VALUE_DB', 'TRUE'); Message_SYS.Add_Attribute(info_msg_, 'NEW_VALUE_DB', 'TRUE'); Fnd_Event_Parameter_API.Register(event_lu_name_, event_id_, id_, info_msg_); -- Update all actions with parameters Fnd_Event_Action_API.Update_Action(event_lu_name_, event_id_, NULL);END;/COMMIT/SET DEFINE &
Great! I didn’t know that. Thanks a lot!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.