cancel
Showing results for 
Search instead for 
Did you mean: 

Date formats for Prompts different in DS1.6 to DS1.5

0 Kudos


I have a set of queries to UNXs in a dashboard that worked fine in 1.5 sending date prompts as yyyy-mm-dd

Since upgrading to 1.6 these no longer work.

I have tried everything I can think of.

Has the required format changed?

Below is the code I am using.

Global Script - ConvertDate

// convert the dates in the date components from yyyymmdd to yyyy-mm-dd

//take the values in the date components and put into a temporary variable
var datefrom = DATEFIELD_1.getDate();


//split the strings down into the year month and day parts
var fromyear = Convert.subString(datefrom,2,4);
var frommonth = Convert.subString(datefrom,4,6);
var fromday = Convert.subString(datefrom,6);


//populate the global date variables with the new format date strings
xdate1 = "20"+fromyear+"-"+frommonth+"-"+fromday;

Text1 - OnClick

DS_2.setVariableValueExt("psDate1",xdate1);

DS_2.loadDataSource();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nicholas,

It's not the date format. It is the setVariableValueExt function that brakes the application in 1.6 This function is not breaking the application if you would set the function in the "On Variable Initialization" property. Anywhere else it breaks the application.

BTW: you don't need to reload the datasource, as it reloads itself when a new variable value is sent to the universe.

PS:

Regards,

Bogdan

0 Kudos

Thank you Bogdan,

I am really struggling to use the On Var Init event.

Using my example above can you suggest how exactly I would code this event and the other components?

Thanks again

Former Member
0 Kudos

Hi Nicholas,

You code is correct. If your code worked in DS 1.5 then I would advise you to wait for a fix from SAP regarding the setVariableValue function outside the "On Variable Initialization" property. There is no point in changing the behaviour of you application. The code should work in further releases as previously. I think/hope they are aware of this matter.

And if a new format will be required (due to DS 1.6 readings of variables) you find this by setting a prompt (which will be read as variable in Design studio) in the query panel in design studio at the datasource level and use one of the values available. Then code a text to display the value of the variable with getVariableValue(ext).

Regards,

Bogdan

Message was edited by: Bogdan Popescu

0 Kudos

Thanks Bogdan

I have confirmed that this is completely unrelated to the date format now and is just the use of the .setVariableValueExt function.

it can be used at start up through the On Variable Initiation event but if you need to reload the DS later with a different value for the variable then you are stuck.

SAP are looking in to it to find a solution but seems terrible if this bug means you cannot re-load a DS with a different prompt post start up.

Also hoping to find out when SP1 will be available.


I will let you know what I find.

Answers (1)

Answers (1)

Karol-K
Advisor
Advisor
0 Kudos

Hi Hicholas,

you should actually have the data source loaded to change its variables.

DS_2.loadDataSource();

DS_2.setVariableValueExt("psDate1",xdate1);

open the prompt dialog and check what is the notation of your variable (key, external key).

you can also use for this the "getVariableValue()" and "getVariableValueExt()" functions and pass it to a message.


In case, you see correct notations, try also to use the "setVariableValue()" (w/o Ext) to pass the internal key.


If this does not work, open incident.


Karol