Question

Restrict the deletion only for "Do not delete connected records"

Hi all,

we want the option for "Delete connected records also" to be disabled/hidden from the page.

 

Please suggest a way for the same.

Like 0

Like

1 comments

Hi,

 

Create a replacing module and select the MultiDeleteResultPageV2 module as a parent and add the following method in the replaced module:

getItemToolsConfig: function() {
						var deleteButton = {
							className: "Terrasoft.Button",
							imageConfig: this.get("Resources.Images.DeleteItemIcon"),
							classes: {wrapClass: ["constraints-icon-delete"]},
							markerValue: "tools-button",
							caption: this.get("Resources.Strings.DeleteRecordButton"),
							style: Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							menu: {
								items: [
									{
										caption: this.get("Resources.Strings.UnlinkRecord"),
										click: {bindTo: "callDeleteService"},
										tag: "CascadeUnlink"
									}
								]
							}
						};
						var ignoreButton = {
							className: "Terrasoft.Button",
							imageConfig: this.get("Resources.Images.IgnoreItemIcon"),
							hint: this.get("Resources.Strings.IgnoreHint"),
							classes: {wrapClass: ["constraints-icon-ignore"]},
							markerValue: "ignore-button",
							click: {"bindTo": "ignoreRecord"}
						};
						var toolsContainer = {
							className: "Terrasoft.Container",
							items: [deleteButton, ignoreButton],
							classes: {
								wrapClassName: ["constraints-item-tools-container"]
							}
						};
						return toolsContainer;
					},

and the following code to the schema diff:

{
						"operation": "merge",
						"name": "ByConstraintsContainerHeaderDeleteButton",
						"parentName": "ByConstraintsContainer",
						"propertyName": "items",
						"values": {
							"menu": {
								"items": [
									{
										"caption": {"bindTo": "Resources.Strings.UnlinkRecord"},
										"click": {"bindTo": "callDeleteService"},
										"tag": "AllCascadeUnlink"
									}
								]
							}
						}
					},

Save the replaced module and refresh the page, the option will be removed.

 

Best regards,

Oscar

Show all comments