Question

Add a hyperlink in edit page

Hi,

 

I would like to add a hyperlink (titled "Details" below) in edit page of a record. When clicking the hyperlink it should redirect to another page in a new tab.

Right now clicking "Details" the page opens in new tab. My issue is that along with the required page, a new tab opens at https://{sitename}/0/Nui/ViewModule.aspx as well. Thus 2 new tabs are opened when I click on the link now.

Below is what I have (Today's agenda is not a detail; it's a control group):

Below is my code:

methods:{

onDashboardDetailsButtonClick:function(){

                let url = ;

                window.open(url, '_blank');

            }

},

diff: /**SCHEMA_DIFF*/[

            {

                "operation": "insert",

                "name": "DashboardDetails",

                "values": {

                    "layout": {

                        "colSpan": 7,

                        "rowSpan": 1,

                        "column": 7,

                        "row": 2,

                    },

                    "itemType":Terrasoft.ViewItemType.HYPERLINK,

                    "enabled": true,

                    "caption":"Details",

                    "click": {"bindTo": "onDashboardDetailsButtonClick"},

                },

                "propertyName": "items",

                "index": 2

            }

]

Can you please tell me what I'm doing wrong and how to resolve this?

Like 0

Like

4 comments
Best reply

Hello Nirupama,

 

Terrasoft.ViewItemType.HYPERLINK item type also has an addtional property "href" and if it's not filled in by default it's automatically filled in with the base application url (https://somesite.creatio.com). You can also see it when hovering the mouse to the link or copy the link adddress from this element. As a result when you click on the item your custom URL is opened and additionally the default URL of the website.

 

If it's possible you should try setting your custom URL to the "href" property like:

getCustomURL: function() {
				return "https://www.wikipedia.org/";
			}
...
{
                "operation": "insert",
                "name": "DashboardDetails",
                "values": {
                    "layout": {
                        "colSpan": 7,
                        "rowSpan": 1,
                        "column": 7,
                        "row": 2,
                    },
                    "itemType":Terrasoft.ViewItemType.HYPERLINK,
                    "enabled": true,
                    "caption":"Details",
					"href": {"bindTo": "getCustomURL"}
                },
                "propertyName": "items",
 
                "index": 2
            },

 

Hello Nirupama,

 

Terrasoft.ViewItemType.HYPERLINK item type also has an addtional property "href" and if it's not filled in by default it's automatically filled in with the base application url (https://somesite.creatio.com). You can also see it when hovering the mouse to the link or copy the link adddress from this element. As a result when you click on the item your custom URL is opened and additionally the default URL of the website.

 

If it's possible you should try setting your custom URL to the "href" property like:

getCustomURL: function() {
				return "https://www.wikipedia.org/";
			}
...
{
                "operation": "insert",
                "name": "DashboardDetails",
                "values": {
                    "layout": {
                        "colSpan": 7,
                        "rowSpan": 1,
                        "column": 7,
                        "row": 2,
                    },
                    "itemType":Terrasoft.ViewItemType.HYPERLINK,
                    "enabled": true,
                    "caption":"Details",
					"href": {"bindTo": "getCustomURL"}
                },
                "propertyName": "items",
 
                "index": 2
            },

 

Thanks, Oscar! That works!

 

As a follow up, is there a way to make the integer value in the above screenshot a hyperlink, so that instead of providing a separate link like "Details", they can on the value and that redirects them to the details page?

Nirupama Mohan Latha,

 

As for the integer field - I am not sure, but you can try converting it into a string column and add the logic as was described here.

Thank you!

Show all comments