Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamically change URL of a button

In QlikView 9, I need to write a macro which take an existing button within a document and change the URL which the button launches based on selections within the sheet. I know how to find the selections and build the URL, but what I cannot determine is what properties to set on the button.


set btn = ActiveDoc.GetSheetObject("BU23")
set prop = btn.GetProperties
--- In here, I need to set the properties for the URL to launch when the button is clicked
btn.SetProperties prop


I've checked through the forums and have not found an example of this, and the API reference refers to a type if IArrayOfActionItems but that type is not defined in the API qvw.

Thanks!

12 Replies
Not applicable
Author

Interesting - I'm finding behavioral differences between the IE Plugin and the Ajax client. What works in one doesn't seem to want to work in the other.

In the IE plugin, I can have the macro determine the URL and launch it via this code

if (params = "") then<pre> msgbox "No selections"
else
dim app
set app = ActiveDocument.Getapplication
app.Launch baseURL & "?" & params, ""
end if


However that does not work in the Ajax client. For the Ajax client, I have to set the value into a variable, and have the button have a second action of "Open URL" with a target of

=URLvariable
.

Where it gets interesting is the method that works for the Ajax client doesn't work in the IE plugin, and vice-versa!

So, the client to be used affects the required solution.

-Kevin
disqr_rm
Partner - Specialist III
Partner - Specialist III

That's what I thought, and so asked you that you are sure if it doesn't work on the server. Regarding AJAX, I don't know much.

Glad that you see something positive.

Not applicable
Author

Hi Troj, Did you find a macro that works fine via Ajax?