cancel
Showing results for 
Search instead for 
Did you mean: 

Pass value from Variable to Dropdown -> convert "unknown type" to "string"

paumcl
Explorer
0 Kudos
694

Hello Together,

I must admit I am struggling with the way SAC handles fetching data and passing it forward.

I have this working coding which is getting the selected value from a dropdown (IPC_Month) and passing it on to a global function:

var monthdetail = IPC_Month.getInputControlDataSource().getActiveSelectedMembers();
var monthdetail2 = monthdetail[0].displayId;
GS_Functions.setCalMonth_KPI(monthdetail2);

Now I want to do the same with a variable X_CALMONTH_05. But now it tells me, that displayID is an unused property.

var month = Chart_KPI_Sales_KF.getDataSource().getVariableValues("X_CALMONTH_05");
var month2 = month[0].displayID
IPC_Month.getInputControlDataSource().setSelectedMembers(month2);

As I need to slice the month variable, I tried it this way, but now the system complains, that it cannot convert from unknown type to string (g_yyyymm is a script variable in string).

var month = Chart_KPI_Sales_KF.getDataSource().getVariableValues("X_CALMONTH_05");
var MM = month.slice(0,2);
var YYYY = month.slice (3,8);
G_YYYYMM = YYYY+MM;
IPC_Month.getInputControlDataSource().setSelectedMembers(G_YYYYMM);

So now I am stuck and thankful for your help.

BR Clemens

View Entire Topic
paumcl
Explorer
0 Kudos

That did it, thanks a lot. Comming from Lumira Designer, it is still some way to go for me to understand this coding.

BR Clemens