Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Accessing parameters in URL

Does anyone have a working example of how to read parameters from a url. I have seen several posts with code like the below but it isn't working for me. I have the below code on the OnOpen event.

The url: http://us5076webd/QvPlugin/opendoc.htm?document=AP%20Published/test.qvw?F1=5



sub SelectDefaultSettings

set

end

sub myCurrency = ActiveDocument.GetVariable("F1").GetContent. String
set ActiveDocument.Field("F1"). Select myCurrency



Can anyone help?

Thanks

3 Replies
MVP & Luminary
MVP & Luminary

Accessing parameters in URL

Is F1 predefined in the document? You must predefine variables to be able to receive them as parameters.

-Rob

Not applicable

Accessing parameters in URL

I have modified my code because initially I had F1 as a field and variable. I changed it to :





set myVar = ActiveDocument.Variables("Var1").GetContent.String
set TgtCurr = ActiveDocument.GetField("F1")
TgtCurr.Select myVar

Under Settings Variable Overview, I added variables for both myVar and Var1.

When I run the above, I get:

Macro parse failed. Functionality was lost
SelectDefaultSettings
Error: Object required: '[string: "2"]'

Any other ideas?



MVP & Luminary
MVP & Luminary

Accessing parameters in URL

Remove "set" from "set myVar....".

Set is only used when the function returns a type of Object.

-Rob