Question

Display Value in section custom for link

Hi team!

 

There is a any way to modify the display value to place a link insted to enter in the edit page?

 

Like 1

Like

5 comments
Best reply

Federico Buffa ...,

 

Good job!

 

There is also an example how to open an external page upon primary display value field click. For example clicking the name of the contact in the "Contacts" section. Using the code below the Wikipedia start page will be opened:

define("BaseDataView", [], function() {
		return {
			messages: {},
			mixins: {},
			diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
			methods: {
				linkClicked: function(href, columnName) {
					if (columnName=="Name" && this.Terrasoft.id == "SectionModuleV2_ContactSectionV2"){
						var url = "https://wikipedia.org";
						window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
					} else {
						this.callParent(arguments);
					}
				},
			},
			properties: {}
		};
	}
);

This should be added to the replaced BaseDataView model.

 

Best regards,

Oscar

Hi Federico, 

In order to read such a business task, you'll need to perform the following steps: 

1. Create a new text(250 char)  field (UsrLink) in Case Object

2. Change display value from "Number"(OOB) to "Link" 

 

That way the field Link will be clickable and will be shown when choosing the record in a lookup field. 

Secondly, you'd need to populate the "Link" field with the actual link to the record. 
I suppose doing so using the business process would be the most convenient: 

1. You need to read the record ID

2. You need to create a ModifyData element that will change the value of the Link field with the following values : 
[#System setting.Website URL#]  +[#Parameter 1#]+ [#ReadTheRecord.First item of resulting collection.Id#]

 Parameter 1 = 'Nui/ViewModule.aspx#CardModuleV2/{EditPageSchemaName}/edit/'

where {EditPageSchemaName} should be populated manually by you with the actual name of the edit page( for example "CasePage" so that the parameter will look like this : 
'Nui/ViewModule.aspx#CardModuleV2/CasePage/edit/'

As a result, you'll receive something like this : 

Best regards,
Yurii

Yurii Sokil,

Hi Yurri,

 

I think I dont express myseft very weel. What I want is to still have the same text in the name (One Pages in this case) but when you click there going to a external web page not in creatio. Will be to sustitute the link for th href of the object.

Somebody has any idea de how modify the behavior of the link for the display value?

I made it with this code on the button call.

 const row = this.getActiveRow();
				 var update = Ext.create("Terrasoft.UpdateQuery", { rootSchemaName: "MyObject" });
				 update.filters.add("RecordFilter", 
									update.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL, "Id", row.get("Id"))
								   );
				 update.setParameterValue("SMField", true, Terrasoft.DataValueType.BOOLEAN);
				 update.execute(function() {
					 this.reloadGridData();
					 this.showInformationDialog("Change impacted");
				 }, this);

 

Federico Buffa ...,

 

Good job!

 

There is also an example how to open an external page upon primary display value field click. For example clicking the name of the contact in the "Contacts" section. Using the code below the Wikipedia start page will be opened:

define("BaseDataView", [], function() {
		return {
			messages: {},
			mixins: {},
			diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
			methods: {
				linkClicked: function(href, columnName) {
					if (columnName=="Name" && this.Terrasoft.id == "SectionModuleV2_ContactSectionV2"){
						var url = "https://wikipedia.org";
						window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth"));
					} else {
						this.callParent(arguments);
					}
				},
			},
			properties: {}
		};
	}
);

This should be added to the replaced BaseDataView model.

 

Best regards,

Oscar

Show all comments