- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 09:54 PM
Hello all,
We have service commitments (service_offering_commitment) attached to service offering(service_offering) as a related list and currently only admins have the ability to remove commitments.
We have added a delete ACL so that certain users having a particular role can remove the service commitments from service offering. And they can delete/remove using edit button in the related list of service offering. This is done but whenever a commitment record is removed, we would like to show an info message on service offering form. How to achieve this? Please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:11 PM
Hi @Pranavi07
By using Business rule you can achieve this
Create one business rule on "service_offering_commitment" this is relationship table of servicefoffering and commitment.
BR condition - before delete
In script you can add InfoMessage like below
Please try this once and Mark Helpful and Correct if it really helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2023 10:11 PM
Hi @Pranavi07
By using Business rule you can achieve this
Create one business rule on "service_offering_commitment" this is relationship table of servicefoffering and commitment.
BR condition - before delete
In script you can add InfoMessage like below
Please try this once and Mark Helpful and Correct if it really helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 04:44 AM
Hi @Kalyani Jangam1 ,
Could you please help me with a similar requirement.
usually we have OOB functionality "Service_offering_commitment" where we related service_offering with service_commitment.
we have designed a similar set up "Business_service_commitment" where we related Business service cmdb_ci_service with service_commitment.
Requirement is that we need a similar removal message when we delete/remove record from business_service_commitment table but the additional requirement here is... When we open business service and try removing service commitments from it, it should check If there are any service offerings attached to this business service and then in these service offerings, there are service commitments (the same commitments which we are trying to remove from business service), it should show error message showing the following commitments are associated to service offerings of this business service. Delete them first and then delete the commitments from business service.
If there are no such dependencies, user should be able to remove commitments from business service and getc message like following commitments removed from BS.
I tried with some script, but error message is showing up many times with in the loop and couldn't progress here. Please help me with the script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 09:24 PM
Hi @Pranavi07
Can you please share your code. It will help me to find out the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 09:37 PM - edited 11-20-2023 09:37 PM
Hi @Kalyani Jangam1 ,
Please find the below code. This is before delete BR on the Business_service_commitment table
var serOff = new GlideRecord("service_offering");
serOff.addQuery('parent', current.u_business_service);
serOff.query();
while (serOff.next()) {
var OffCom = new GlideRecord("service_offering_commitment");
OffCom.addQuery('service_offering', serOff.getUniqueValue());
OffCom.addQuery('service_commitment', current.u_service_commitment);
OffCom.query();
if (OffCom.next()) {
gs.addErrorMessage("There are Service Commitments with name" + current.u_service_commitment.name + " in the Service Offering " + serOff.name + " Delete those first to delete the Service Commitments from this BS");
current.setAbortAction(true);
} else {
gs.addInfoMessage("The commitment has been deleted from Business service");
}
}