How to get current facility id in a component for use in titleUrl?

#1

I’ve a tile in FacilityHome component (which is in Facility page) that I’m trying to link to the analyzePerformance tab of this faciliy.

In the titleUrl, I tried with record.data.id/data.id/params.id they all give empty strings, when trying with id I got development (which I beleive is the ID of the UIConfig environment):

            {
                "component": "EnergyManagement.FacilityEnergyEUI",
                "id": "FacilityEnergyEUIMetricTile",
                "renderTo": "#energyEUIMetricTile",
                "titleAlign": "center",
                "titleUrl": "/energymgt/facility/{{ params.id }}?activeTabs=FacilityTabPanel=analyzePerformance",
                "box": true
            },

What the proper data holder in this case?

0 Likes

#2

To resolve the record.data.id, it will call C3.script.helpers.matchDynamicContent behind the scene. It will try to extract all dynamic fields from record, pageParams and environment, in this order of priority. The data you get, development with id, most probably comes from environment. What you are missing in your component definition is the data field with a record from which you will get the id.

0 Likes