Hi,
how to add hyperlink to Accounts object?
Thanks
suresh g.
Like
Dear Suresh,
The possible ways of accomplishing the task are described in the following topic - https://community.bpmonline.com/questions/hyperlink-fields. Check it out!
Lisa
It's very easy to make the field linkable in the grid. You just need to put https:// before the field value and once you display it in the grid, it turns into a hyperlink:
Please note that in this case the field's value won't be clickable on the edit page itself. To make it clickable there would take some more effort.
In the diff of your custom field you need to add the following code (the name of the custom field from the example below is 'UsrPhoto'):
"showValueAsLink": true, "href": { "bindTo": "UsrFoto", "bindConfig": {"converter": "getUsrFotoLink"} }, "controlConfig": { "className": "Terrasoft.TextEdit", "linkclick": { bindTo: "onUsrFotoLinkClick"} }
Then you need to add the methods like these:
getUsrFotoLink: function(value) { return { "url": value, "caption": value }; }, onUsrFotoLinkClick: function(url) { if (url != null) { window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth")); return false; } }
Kindly note that the value of the field should start with 'http/https' for it to be considered a hyperlink.
Furthermore, here is full diff array item code, manually added part marked with bold font:
{ "operation": "insert", "name": "UsrURLpage22872546-f334-4b46-a445-112b532455c4", "values": { "layout": { "colSpan": 12, "rowSpan": 1, "column": 0, "row": 3, "layoutName": "Header" }, "labelConfig": {}, "enabled": true, "bindTo": "UsrURLpage", "showValueAsLink": true, "href": { "bindTo": "UsrURLpage", "bindConfig": {"converter": "getUsrURLpageLink"} }, "controlConfig": { "className": "Terrasoft.TextEdit", "linkclick": { bindTo: "onUsrURLpageLinkClick"} } }, "parentName": "Header", "propertyName": "items", "index": 6 }
Here is implementation of methods:
methods: { getUsrURLpageLink: function(value) { return { "url": value, "caption": value }; }, onUsrURLpageLinkClick: function(url) { if (url != null) { window.open(url, "_blank", "height=" + this.get("WindowHeight") + ",width=" + this.get("WindowWidth")); return false; } } },