Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
The #1 reason QlikView customers adopt Qlik Sense is a desire for a modern BI experience. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

Triggers

Hello gurus

In Document settings and triggers one can create a trigger for OnAnySelect. Meaning any object selected/touched will trigger an event/action.

Is it possible to send the Object's ID (or name) to a macro if a macro is set to run on the trigger?

For instance, if a table's ID is TB01 and a user selects a record in the table, I would like the trigger to send to a macro that TB01 was activated.

Is that possible?

Thanks

Josh

1 Solution

Accepted Solutions
Highlighted
Master II
Master II

This script should return the object id of the active object on the active sheet:

set s=ActiveDocument.ActiveSheet
objs=s.GetSheetObjects
for i=lbound(objs) to ubound(objs)
     if objs(i).IsActive then
          id = obj(i).GetObjectId
          msgbox("ID = " & id)
     end if
next

View solution in original post

5 Replies
Highlighted
Master II
Master II

I don't believe that OnAnySelect will trigger when an object is selected. I think it is triggered when a selection is made in any field.

Highlighted
Specialist
Specialist

Thanks.

That is what I meant. If a field is selected -- say Name of a SalesPerson in the table, a trigger is fired. I know that for a fact as I have created such an event/action.

However, I would like to send to the macro the name of the table from which the event was triggered.

Is that possible?

Like ActiveDocument.ActiveObject(name)  Is there such a thing as "ActiveObject(name)" or any way to pass the object's name.

Thanks

Highlighted
Master II
Master II

This script should return the object id of the active object on the active sheet:

set s=ActiveDocument.ActiveSheet
objs=s.GetSheetObjects
for i=lbound(objs) to ubound(objs)
     if objs(i).IsActive then
          id = obj(i).GetObjectId
          msgbox("ID = " & id)
     end if
next

View solution in original post

Highlighted
Specialist
Specialist

Wonderful!

Exactly what I was looking for!

You are it!!

Much obliged.

 

Highlighted
Specialist
Specialist

 

DID NOT WORK UNTIL...

It took me some long moments of frustration to find the error in your code  😆

set s=ActiveDocument.ActiveSheet
objs=s.GetSheetObjects
for i=lbound(objs) to ubound(objs)
     if objs(i).IsActive then
          id = obj(i).GetObjectId
          msgbox("ID = " & id)
     end if
next

 

SHOULD BE

 

set s=ActiveDocument.ActiveSheet
objs=s.GetSheetObjects
for i=lbound(objs) to ubound(objs)
     if objs(i).IsActive then
          id = objS(i).GetObjectId
          msgbox("ID = " & id)
     end if
next

And then it works.

Once again thank you