on 07-10-2015 2:42 PM
I have read everything on the web regarding this topic but found no working solutions. Can someone please help me write a JavaScript function that reads a value of a BW variable used in a DataProvider? I have tried everything, including advice posted in one of the blogs which is often quoted here as a solution, but nothing seems to be working. Please help me!
Ok. I think I figured it out, so I am giving my solution below.
I have created an infofield INFO_FIELD_ITEM_1 and bound my variable to it so that it is displayed when I execute my template (although it can be hidden if necessary). As far as I am aware, using and infofield is the only way to pass the value of the variable into our WAD template.
I managed to retrieve the value of the variable from the infofield using the following function:
function GetMyName(){
var x = document.getElementById("INFO_FIELD_ITEM_1_unid1").getAttribute("value");
alert(x);
}
To test it, I bound the JS function to a button item, but obviously it can be used in other ways.
Hope that helps someone!
A.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Lukas,
the only way you can get a variable value to a javascript variable is if you have it on screen. if you are passing to another BW query - you can use the RRI option and call the RRI Receiver through the URL and the values will get passed.
My knowledge on the WEB API is rusty but remember doing something like that...
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.