Removing a pending application
NOTE: You will need access to TCIDP in order to perform this operation. When using tc_user schema for TCIDP, tables will be listed under Synonyms.
Determine which application is being referred to by running the attached query in TOAD, replacing the text “INSERT_TC_USER_ID” with the user’s TC User ID.
See script below
From the list of results, determine which application is the one to be removed. There is usually only one application with Pending Tasks, but not always. If need be, confirm with the client. The date of the application is a good reference point. The application date is the Date Created column in the results for the first task of the application. The client may also provide just the due date, then the application date determined by subtracting 10 days from the due date (more or less).
Once the application to be removed has been identified, get the relative application_id and related_application_id values from the list of results.
In TOAD, go to table UA019_TASK and locate ALL RECORDS where ua019_task.applicaion_id is equal to either the application_id or related_application_id value from #3 above. Update the value for ua019_task.task_status_cd to 3 (Declined).
The prepared query might look like as follows, since we obtain application_id and related_application_id from the query in step 2 and use it in the where clause):
select * from UA019_TASK where application_id = 34603 or application_id=34551; (Returns 6 records)Update UA019_TASK set task_status_cd = 3 where application_id = 34603 or application_id=34551; (Updated 6 records, in this case, just one record is pending but we still need to update all 6 records since the related application id should be taken into consideration)
In TOAD, go to table AA009_APPLICATION and locate any records (max. 2) with the application_id or related_application_id values. Update the value for aa009_application.application_status_cd to 3 (Declined).
The prepared query might look like as follows:
select * from AA009_APPLICATION where application_id = 34603 or application_id=34551 ; (returns 2 records)Update AA009_APPLICATION Set application_status_cd = 3 where application_id = 34603 or application_id=34551; (Updated 2 records)
Notify user.
TCID Application Locator
SELECT
ua019.inspector_person_id "inspector_person_id",
ua019.application_id "application_id",
-- UA019.retirement_id,
aa009.related_application_id "related_application_id",
ua019.task_sequence_num "task_sequence_num",
--aa004.tc_user_id "tc_user_id",
aa004.last_name_nm || ',' || aa004.first_name_nm AS "Inspector Name",
tc040.application_function_etxt "Application Type",
tc021.task_type_etxt "Task Type",
ta036.task_status_etxt "Task Status",
ta011.inspector_group_etxt "Sent to Group",
tc025.user_role_type_etxt "Sent to Person Role",
(CASE
WHEN ua019.sent_to_person_id IS NULL THEN ''
ELSE (aa004_to.last_name_nm || ', ' || aa004_to.first_name_nm)
END)
AS "Sent To Person Name",
--aa004_TO.tc_user_id AS "Sent To Person TC User ID",
TO_CHAR(ua019.date_created_dte, 'YYYY-MM-DD') "Date Created",
TO_CHAR(ua019.date_last_update_dte, 'YYYY-MM-DD') "Last Updated Date",
aa004_updated.last_name_nm || ',' || aa004_updated.first_name_nm "Updated By",
ua019.user_last_update_id "Updated By Id"
FROM ua019_task ua019
INNER JOIN aa004_person aa004 ON (ua019.inspector_person_id = aa004.person_id)
INNER JOIN aa004_person aa004_updated ON (ua019.user_last_update_id = aa004_updated.person_id)
LEFT JOIN aa009_application aa009 ON ua019.application_id = aa009.application_id
LEFT JOIN tc021_task_type tc021 ON tc021.task_type_cd = ua019.task_type_cd
LEFT JOIN tc040_application_function tc040 ON ua019.application_function_cd = tc040.application_function_cd
LEFT JOIN tc025_user_role_type tc025 ON tc025.user_role_type_cd = ua019.sent_to_user_role_type_cd
LEFT JOIN aa004_person aa004_to ON ua019.sent_to_person_id = aa004_to.person_id
LEFT JOIN ta011_inspector_group ta011 ON ua019.sent_to_inspector_group_cd = ta011.inspector_group_cd
INNER JOIN ta036_task_status ta036 ON ua019.task_status_cd = ta036.task_status_cd
WHERE aa004.tc_user_id IN ('INSERT_TC_USER_ID')
AND ua019.date_deleted_dte IS NULL
ORDER BY aa004.last_name_nm || ',' || aa004.first_name_nm,
ua019.application_id DESC,
ua019.task_sequence_num DESC,
ua019.application_id;