- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 01:31 AM - edited 01-03-2024 01:43 AM
There is a custom M2M table created by mistake in GRC: Risk Management scope. The M2M definition record in "sys_m2m" table has been deleted, but the table definition in "sys_db_object" table still exists, along with the field definitions and label configurations. I wanted to delete this table and capture the deletion in an update set, so that it can be moved to other instances as well. However, the delete UI action is not visible in the table definition record. I have seen other community page solutions pointing to deactivate an ACL but I wanted to check if it is possible to do this without making changes to an OOTB ACL, possibly via a fix script.
Please suggest if this is achievable.
Thanks.
Edit: Reason why I posed the question is that it is not possible to delete the table as it was created with a name prefix "sn_risk" and not with the prefix "u_", making it impossible to delete the table manually. Hence required solution to delete it via script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 02:08 AM
Hello @Kirthika D ,
You can below below snippet in background script.
var tableDeletion = new TableUtils();
tableDeletion.dropAndClean('Table_nam_here');
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 12:13 AM - edited 01-03-2024 08:59 AM
Never mind, I just found that checking the "unloadable" checkbox in the fix script creates customer updates for the changes done by executing the script. This helps.
Thank you,
Kirthika D
Edit: TableUtils is not accessible from outside Global scope, but it can be called from Global scope to delete tables in other scopes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 02:08 AM
Hello @Kirthika D ,
You can below below snippet in background script.
var tableDeletion = new TableUtils();
tableDeletion.dropAndClean('Table_nam_here');
Kindly mark the answer ✔️ Correct or Helpful ✔️ If it addresses your concern.
Regards,
Siddhesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:05 PM
Hi @Siddhesh Gawade, Thank you for the reply.
Before I attempt to run the script, I want to get a few doubts cleared.
This M2M and table was created and moved to other instances as a part of an update set.
The M2M deletion was captured in the update set as DELETE action, but the table and the field creations were captured as INSERT or UPDATE action.
- If I run the above as a fix script, will the change be captured somewhere?
- During clone and restore, will the table be restored again? (which is an undesirable behavior). How can I make sure this is handled to not be restored?
Thanks,
Kirthika D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:12 PM
If you run this script it will delete the table as as well as respective fields.
Once deleted, as this is the custom table, it shouldn't be restored unless you preserve this table. So as per my knowledge it will not be restored.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-02-2024 11:18 PM
Sorry to keep dragging this, but the update set which has the creation updates of the table has other significant updates and will be restored. So if there is a way possible to capture the deletion in another update set, I can make sure that the table doesn't get restored. Would it be possible to capture the deletion in an update set when it is executed as a script?