trigger_custom_event and merge_table_records_with_pk api's integration