on 01-04-2016 11:29 AM
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();
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.
Regards,
Bogdan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.