- 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-20-2023 11:25 PM
Hi @Pranavi07
try below code once
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.sys_id);
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");
}
}
Please let me know if it helpful or not.