cancel
Showing results for 
Search instead for 
Did you mean: 

Change properties of Attachment Component on Create Maintenance Request [F1511A] via Adaptation

tursko
Participant
0 Kudos
102

Hi experts, 

I am trying to update the properties of the Attachment Reuse Component that is included on the standard Create Maintenance Request application. I want to update the flavor to "withCheckin" and remove the "Add a Link" action. I have created an adaptation project in BAS and I have tried the following: 

  • Creating an extension controller, attaching onto an event, getting the component, and attempting to change the properties. 
  • Adding a change to the manifest app variant.

Unfortunately, I have had no luck. I can technically update the properties of the component via the extension controller, but my changes are overridden once the component entirely loads in. If I could find a way to set the properties after the component is entirely loaded in then that would work. 

Another option is adding a change to the manifest app variant. I was able to successfully do this on "My Maintenance Requests" but that's much more straight forward since its a true Fiori elements application. 

Example of what I am trying to accomplish: 

tursko_0-1739813397758.png

 

Accepted Solutions (1)

Accepted Solutions (1)

tursko
Participant
0 Kudos

I wasn't able to solve the issue using a manifest change, but I was able to change the properties with a controller extension. 

I made a new function that gets called after any batch request completes on the component. 

 

_setAttachmentServiceAttributes: function () {
	var oComponent = this.getView().byId("workRequestCreateAttachSrvCompContCreate").getComponentInstance();
	oComponent.getRootControl().getController().oModel.attachBatchRequestCompleted(function (oEvent) {
		oComponent.setFlavor("withCheckin");

		var fieldControl = oComponent.getAttributes();
		fieldControl._VisibleActions.RENAME = true;
		fieldControl._VisibleActions.DELETE = true;
		fieldControl._VisibleActions.ADD = true;
		fieldControl._VisibleActions.ADDURL = false;
		fieldControl._VisibleActions.DOCTYPE = false;
		fieldControl._VisibleAttributes.ENABLELINK = false;
		oComponent.setAttributes(fieldControl);

		oComponent.setMode("I");
	}.bind(this));
}

 

tursko_0-1740416970061.png

 

Answers (0)