Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to change Button ID

Hello,

I am trying to dynamically add a button to my Qlikview page using

set newbutton = ActiveDocument.ActiveSheet.CreateButton

set prop = newbutton.GetProperties

prop.Text.v = "Remove"

newbutton.SetProperties prop

The button gets added correctly but the trouble I am having is trying to set the ID of this new object.

I am also create a new text object and using the API I found that it is very easy to set the ID of this type of object using

set mytext = ActiveDocument.ActiveSheet.CreateTextObject

prop = mytext.GetProperties

prop.Layout.Frame.ObjectId = "Document\NewID"

prop.Layout.Text.v = Tot

mytext.SetProperties prop

Is there a similar way of doing the above for a button?

Many thanks for your help!

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

Technically: For button Frame object can be accessed directly from properties not from Layout.

Check with this

prop.Frame.ObjectId="Your Dynamic ID"

Hope it helps

View solution in original post

3 Replies
christian77
Partner - Specialist
Partner - Specialist

Well, do it with a text object and assign an action to it. The only differences between buttom and text object is that the button does a little go down effect when you click on it and that it shows engraved text where there is no action assign to it.

good luck

CELAMBARASAN
Partner - Champion
Partner - Champion

Technically: For button Frame object can be accessed directly from properties not from Layout.

Check with this

prop.Frame.ObjectId="Your Dynamic ID"

Hope it helps

Not applicable
Author

Thank you this is just what I was after!