Discussion board where members can get started with QlikView.
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?
This script should return the object id of the active object on the active sheet:
set s=ActiveDocument.ActiveSheetobjs=s.GetSheetObjectsfor i=lbound(objs) to ubound(objs) if objs(i).IsActive then id = obj(i).GetObjectId msgbox("ID = " & id) end ifnext
View solution in original post
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.
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.
Like ActiveDocument.ActiveObject(name) Is there such a thing as "ActiveObject(name)" or any way to pass the object's name.
Exactly what I was looking for!
You are it!!
DID NOT WORK UNTIL...
It took me some long moments of frustration to find the error in your code 😆
set s=ActiveDocument.ActiveSheetobjs=s.GetSheetObjectsfor i=lbound(objs) to ubound(objs) if objs(i).IsActive then id = objS(i).GetObjectId msgbox("ID = " & id) end ifnext
And then it works.
Once again thank you