Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sreeni_qvd
Creator
Creator

How to store the Object Id's into testbox with using macros.

Hi All,

If user select any object in our dashboard, that object id and values will store into one testbox. How to implement this one.

This is purpose of document chaining. ex: URL&select=LB48,$(VURL)

$(VURL) means= =GetFieldSelections(Year)

For above example, LB48 is the  object id, I want to store object id dynamically if user select any object. How to implement this one.

Regards:

Sreeni

Labels (2)
8 Replies
PradeepReddy
Specialist II
Specialist II

As per my understanding, you want to get the Active Object ID.

There is no direct function in QlikView to achieve this and you have to code a macro to get the same.

Thanks, Pradeep

PradeepReddy
Specialist II
Specialist II

Here is the approach

1) Create a  variable vVar1

2) Create a Macro.

    sub Run_Macro

          set vVar1=ActiveDocument.Variables("vVar1")

          objs=ActiveDocument.ActiveSheet.GetActiveSheetObjects

          for i=lbound(objs) to ubound(objs)

              vVar1.SetContent objs(i).GetObjectID(),true

          next

     end sub

3) Trigger this macro on each selection

     Document properties---> Triggers--->onAnySelect--->Add Action---> Add--> External---> Run Macro---> Macro Name (Run_Macro)

4) Use the variable vVar1 in text box.

Thanks, Pradeep

sreeni_qvd
Creator
Creator
Author

Hi Pradeep,

                    Thanks for the quick reply

It's working fine,

Object id is coming into Text box, but i want along with the object vales dynamically.

Ex: LB01= Year and LB01 values 2010,2011,2012 

Like: LB01,2010 When user click the LB01.


Regards:

Sreeni

PradeepReddy
Specialist II
Specialist II

Hi Sreeni,


Along with the above process, use the function GetCurrentSelections() in text box, so that you will get the current acivae object id along with the current selection  values.

Hope this will resolve your issue.

Thanks,

Pradeep

sreeni_qvd
Creator
Creator
Author

Hi Pradeep,

PFA,

Pradeep i want user will select any list box or any objects, I want object ID and values only

I don't want field name, Here field names also coming. Field name Description and Opp Record Type.

Capture.PNG.png

I want multiple object id's and multiple values.

Output: Like this LB48,HPFS, LB50,2010, LB60,sales

Regards:

Sreeni

PradeepReddy
Specialist II
Specialist II

Use the bellow function along with the variable in text box.

subfield(GetCurrentSelections(),':',2)

Thanks,

Pradeep

sreeni_qvd
Creator
Creator
Author

Hi Pradeep,

Thank you for immediate reply,

But here Opportunity Record Type object id= LB71 and Function type object id= LB49

I want output LB71, HPFS, LB49, Direct Lease

HPFS and Direct Lease are those object id values

Capture.PNG.png

PradeepReddy
Specialist II
Specialist II


The macro which I provided you only to get the active object....

I think it is not possible to get all the object ID's which do you currenlty selected. As of mt knowledge it is possible to ge the the current active object ID.

Thanks,

Pradeep