- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2023 08:03 PM
Hi Community,
I have a requirement to provide an option of Delete button on Vendor Records for Vendor Manager role.
Whenever the delete button clicks associated Engagements should also get deleted. The delete functionality should be available on Vendor Management workspace.
Please help me in writing script for workspace delete button.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2023 09:43 PM
Hi @bejawada
you don't need to script anything. just make sure that the respective cascade delete rules are set correctly. Then ServiceNow will delete referencing records automatically in case the parent records gets deleted.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 08:36 PM
Hi @bejawada
sorry, but it is still not clear what you have done.
"I have used the below UI Action script in my environment and make it visible on the Form" --> makes no sense, as the "Delete" button is visible by default and there is no need to customize anything.
So why cannot you explain exactly WHAT you have done and WHY.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 08:50 PM
Since Global DELETE UI action is restricted to limited roles, I want a DELETE UI action to be given to TPRM Manager role on core_company table. So I have created a custom UI Action on core company table.
Since TPRM Managers will be using "Vendor Management Workspace" for operating, I have used workspace client script shown in the screen shot.
Let me know if this is enough or please suggest if we have any alternate approach for deleting records on workspace.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 09:13 PM
Again, there is no need to customize/implement something.
If you want users with a certain role to delete records on a certain table, you just have to add the respective ACLs. Then the OOTB "Delete" button will be visible in the Workspace.
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 12:34 AM
Hello @Maik Skoddow ,
I have followed the steps that you have guided.
Step1: Created a User(TPRM Manager) and gave him a role(sn_vdr_risk_asmt.vendor_risk_manager).
Step2: Modified the Delete ACL and added the above role
Step 3: Modified the cascade rule of the field "Vendor" in Engagement table.
Step 4: Impersonated with TPRM Manager
Step 5: created a Vendor Record(Test Vendor)
Step 6: Created an Engagement for "Test Vendor" as "Test Engagement"
Step 7: Opened the Workspace under Vendor Management Application.
Step 8: Open "Test Vendor" Vendor record and clicked on Delete Button.
Step 9: Both Vendor and associated Engagement got deleted. At the same time a new empty vendor got created automatically.
I am not sure how is this empty record getting created.
Note: This empty record is getting created only when impersonated with TPRM Manager. No records are getting created when admin delete Vendor.
This is happening only when record deleted from Workspace.
All of these are happening in PDI as well, I have tried in my PDI and here also an empty record is getting created automatically.
Please let me know if anything else needed.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 01:13 AM
Hi @bejawada
thanks for the extensive explanation of the issue which is bizarre enough to have no good answer for you. Now I would have to go on your instance myself and try to find the cause. Everything else would be just guesswork and not serious.
Maik