Hi Community
I want to remove the hyperlink from lookup fields. To achieve this I have followed this community article. This worked fine on the edit page. But on the section list view hyperlinks are still showing as shown below.
Is there a way I can remove the hyperlink on the list view conditionally as well instead of removing the "Display value" property from the object setting?
Any lead will be appreciated.
Regards,
Sourav Kumar Samal
Hi, the logic for marking columns as links on section pages is based on the method addLookupColumnLink and if you want to modify it, you need to override it. For example, in the contact section, I need to remove a link to the column "Owner". The code to do this:
define("ContactSectionV2", [], function() { return { entitySchemaName: "Contact", details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/, methods: { addLookupColumnLink: function(item, column) { if (column.columnPath == "Owner"){ console.log("We don't add link"); } else { this.callParent(arguments); } } } }; });
Dmytro Vovchenko,
I have tried the above code, but the method was never called, attached a screenshot for reference.
Is there anything I am missing here?
Regards,
Sourav
Sourav Kumar Samal,
If you want to remove a link from a primary column the method you need in this situation is addPrimaryColumnLink
define("ContactSectionV2", [], function() { return { entitySchemaName: "Contact", details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/, diff: /**SCHEMA_DIFF*/[ ]/**SCHEMA_DIFF*/, methods: { addLookupColumnLink: function(item, column) { if (column.columnPath == "Owner"){ console.log("We don't add link"); } else { this.callParent(arguments); } }, addPrimaryColumnLink: function(item, column) { return false; } } }; });
Result:
Dmytro Vovchenko,
Is there a way to do the same thing on the dashboard list?
Regards,
Sourav
Sourav Kumar Samal,
In this case, look at the DashboardGridModule schema. I believe you would need to modify the same methods. But, overriding the
DashboardGridModule is much more difficult than the section pages.