Before Delete Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2016 03:03 AM
Hi All,
I have a requirement that if user click on Delete button on shopping cart page, then it should restrict to delete and print a info message on it.
So for this i have written a Before Delete Business Rule and it is restricting user to delete catalog item. But when i am opening any catalog item page that time that BR is running and it gives an info message before added to the cart.
I did not understand which functionality is affecting.
Can anyone suggest on it.
Below is the BR i have written.
BR is on "sc_cart_item" table.
function onBefore(current, previous) {
gs.log('Inside On After function');
var gr = new GlideRecord('sc_cart_item');
gr.addQuery('cat_item' , 'c89e448b4f034e004430eb1e0210c751');
gr.query();
while(gr.next())
{
current.setAbortAction(true);
gs.addInfoMessage('Should not be Deleted');
gs.log('inside if for deletion message');
}
}
Thanks in Advance.
Regards
Bhushan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2016 03:26 AM
Did you try the fix I have provided - we have been using this fix for several years, and it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2016 03:32 AM
Salsekar,
You want to pup up a message when the user delet an item from the shopping cart ?
You cannot use a business rule since the record is not yet inserted into the database....