Question

How to make a field on a detail display as a link

I have a detail on bpm'online studio and one of the fields is an document id for a document that is stored in our Oracle Content Management system. 

How can I make the document Id display as a link on the detail, so I can  bind a function to "linkclick" to open that document in the Content Management system?

The idea is that when the user to clicks on the document  id, the document will open.

I tried https://community.bpmonline.com/questions/show-captions-instead-absolut…,

https://community.bpmonline.com/questions/add-hyperlink-field-list and 

 https://community.bpmonline.com/questions/hyperlink-fields without any luck.

 

Thanks,

Jose

Like

6 comments

Dear Jose,

To do such an operation you can simply copy the URL of the document you want to display and insert it like a text into the detail that you've created. When users will click on this link, they will be moved to this document and they will be able to see it.

Thank you for choosing bpm’online!

Oscar Dylan,

Thanks Oscar, but there is no URL, I still need the field to be displayed as a link. I will add some logic to open the document once the link is clicked. 

Hello Jose,

Our application considers all links to be links in text fields. So, if you will insert a text that is the link then our application automatically consider it to be link. If this link can be opened via web-browser or via any other application that can read links than it will be opened via our application. The main point for you now is to create a link to the element in your storage system that can be read. And then you can simply insert it into the text field of our application.

Oscar Dylan,

Your response gives me an idea, but the link would be too long to display on the page. The link will be something like 

https://<server name>/0/ServiceModel/ProcessEngineService.svc/DisplayImage/Execute?ImageID=123456789 

instead of displaying all that on the page I want to display just 123456789 and to go to that URL when the link is clicked.

Thanks,

Jose

 

 

 

Jose Hernandez,

There is a perfect article in our bpmonline academy and it regards adding pop-up hints. You can do one for the text field you need. For example, you have the field with document id and you can add a pop-up hint in one of the ways that are described in the academy and anyone can click on this hint and get additional information that is needed via link that you can put in the hint. Please, pay attention to the "Adding a web-resource link to a tooltip" section in this article because it describes the process of adding the link.
Another way to solve the issue is to add another string field near "document id" field, name it, for example, "Description" and then put the link into this field. You can choose any of these ways and they will both work.

Oscar Dylan,

Thanks Oscar. I tried the article you mentioned, but I could not make it work. The article instructions are for an edit page and I need the changes on a detail. 

I finally was able to make work by making some modifications to the instructions given on https://community.bpmonline.com/questions/show-captions-instead-absolut… (see below) . I'm not sure if there is a more efficient way to get the document id, but the changes worked for me.

Thanks,

Jose

Basically instead of 

addColumnLink: function(item, column) {
                this.callParent(arguments);
            },

I did 

addColumnLink: function(item, column) {
                if (column.columnPath === "UsrDocumentCdrId") {
                    var columnPath = column.columnPath;
                    var onColumnLinkClickName = "on" + columnPath + "LinkClick";
                    var value =  this.get("Resources.Strings.OpenCdrDocumentCaption");                    
                    if (Ext.isEmpty(item[onColumnLinkClickName])) {
                        item[onColumnLinkClickName] = function() {
                            var config = {
                                title: value,
                                caption: value,
                                target: "_blank"
                            };
                            return config;
                        };
                    }
                }
                this.callParent(arguments);
            }

and instead of 

linkClicked: function(recordId, columnName) {
                if (columnName === "UsrCaption") {
                    var path = this.get("UsrURL"); //"https://www.google.com";
                    window.open(path);
                }
                this.callParent(arguments);
            }

I did

            linkClicked: function(recordId, columnName) {
                if (columnName === "UsrDocumentCdrId") {
                    var esq = this.Ext.create("Terrasoft.EntitySchemaQuery", {
                        rootSchemaName: "UsrCfrDocuments"
                    });
                    esq.addColumn("UsrDocumentCdrId", "UsrDocumentCdrId");
                    esq.getEntity(recordId, function(result) {
                        if (!result.success) {
                            this.showInformationDialog("Resources.Strings.UnableToGetDocumentIdLink");
                            return;
                        }
                        var documentCdrId = result.entity.get("UsrDocumentCdrId");
                        var path = this.getCdrDocumentUrl(documentCdrId);
                        window.open(path);
                    }, this);
                    return false;
                }
                this.callParent(arguments);
            },
            getCdrDocumentUrl: function(documentId) {
                return " https://<server name>/0/ServiceModel/ProcessEngineService.svc/DisplayImage/Execute?ImageID=" + documentId;
            }

 

 

Log in or register to comment