cancel
Showing results for 
Search instead for 
Did you mean: 

SAC APP Designer - How to read selected value in a dimension cell

marcpara
Explorer
0 Kudos

Hi,

I'm not able to achieve the below requirement, hopefully someone has a solution if it's possible in SAC.

Requirement:

When I click on a cell in a table, I would like to get the value in order I can pass it in an URL (in my case it's a dimension).

Example:

I have a table with purchase order number, it's cost object and the related purchase request number.

If I click on a purchase order number in the table, I would like to call the webgui URL to display the purchase order so I need to get the value of the selected cell.

Same should apply if I click on the cost object number and the purchase request number.

Current solution:

So far in a table I can add only 1 hyperlink and I use it for the PO number.

In my table, for the event onSelect, I define the below code but it works only for 1 dimension (where ever I click in the table it will get the value of the cell of the dimension purchase request number).

var vSelection = Table_2.getSelections()[0];

console.log(vSelection);

var vSelData = Table_2.getDataSource().getResultMember("PURCHASEREQUISITIONID", vSelection).description;

console.log(vSelData);

var vURL1 = "https://myurl.com/LAUNCHPAD#ZMM_PurchaseRequisition-manage&/PurchaseRequisition/";

var vURL = vURL1.concat(vSelData);

console.log(vURL);

NavigationUtils.openUrl(vURL, true);

Accepted Solutions (0)

Answers (1)

Answers (1)

eeddggaarr
Contributor
0 Kudos

Hi Marc,

I do not think that you can configure built-in hyperlink function in a table to achieve your requirements.
Additionally, it is not possible yet to retrieve a single dimension value from a table with > 1 dimension via scripting directly => have a look here.

However, if a user selects one cell in a table you could retrieve the three dimension values of interest and show them e.g. in buttons above the table. if the user clicks on button 1 the url will open with PO order number, if he clicks on button 2 URL will open with cost object,.. Or you use a popup for that.
a second workaround: in table styler define selection type: single cell:

whenever a user sets a filter you can retrieve
  • if a filter is set for which of the three dimensions
  • what is the filtered value
console.log(Table_1.getDataSource().getDimensionFilters("technical_dimension_name"));

with that you could build your url and initiate url call if e.g. resultSet of table changes.

br
edgar

marcpara
Explorer
0 Kudos

Hi Edgar,

Thanks for your answer and the link to your improvement request, it's exactly what I need.

In my table styler, I already defined selection type to single cell but it still retrieves the value of all the dimensions of the table (I have more than the 3 dimensions I mentioned).

I will have a look at your solution of showing the three dimension values in 3 buttons.

br

Marc