RE: Is there is a way to not display the `remove` field on a custom sublist when in view mode only?
Is there is a way to not display the `remove` field on a custom sublist when in view mode only? It causes issues since User Event scripts don’t run in View mode
Sharing this if anyone else is looking for a solution. Was able to do it via User Event > BeforeLoad:
var hideFld = form.addField({
id:’custpage_hide_buttons’,
label:’not shown – hidden’,
type: serverWidget.FieldType.INLINEHTML
});
//for every element you want to hide, modify the scr += line
var scr = “”;
// On Edit Mode, inspect element to get ID of the Remove button.
scr += ‘jQuery(“#recmachcustrecord_id_remove”).hide();’;
// On View Mode
scr += `jQuery(‘a:contains(“Remove”)’).hide();`;
//push the script into the field so that it fires and does its handy work
hideFld.defaultValue = “<script>jQuery(function($){require([], function(){” + scr + “;})})</script>”;
Will this solution work if a sublist has more than 25 lines i.e. paginated data and select the 2nd page and switching the pages under sublist?