Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
siddharth_kulka
Creator II
Creator II

Macro event doc.fields

Hi

Business Rule:

There is a generic rating field one tab with values 1,2,3,4,5,6,7,8,9,10

On a different tab, there are product wise ratings Product A: 1,2,3,4,5,6,7,8,9,10 Product B: 1,2,3,4,5,6,7,8,9,10

Goal: If I select 10 in generic field, 10 should be selected in product A and product B list boxes

I want to pass multiple fields(parameters) in doc.fields event, but I don't think it is permitted. Is there a work around? I am achieving my goal by writing multiple doc.field statements, but its not the best way to do it, one feels

Below is working code, but is there any way to avoid these multiple doc.fields statements?

set Doc = ActiveDocument
set F1_Selections = Doc.fields("CPR_Rating").GetSelectedValues
set F2 = doc.fields("A")
set F3 = doc.fields("B")
F2.SelectValues F1_Selections
F3.SelectValues F1_Selections

Any help will be appreciated.

Thanks,

Siddharth

Labels (1)
1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Well, there might (or might not) be a better way, but that IS basically how I've done it in the past when I've needed to syncrhonize fields without actually making them the same field in the model.

View solution in original post

3 Replies
johnw
Champion III
Champion III

Well, there might (or might not) be a better way, but that IS basically how I've done it in the past when I've needed to syncrhonize fields without actually making them the same field in the model.

Not applicable

Hi Siddharth,

Please see attaced qvw, I hope you are looking for this. I have trigger on ValGen filed chage, it calls macro SelectTest and selects corosponding vales in producta and productb. This is just to give you an idea.

siddharth_kulka
Creator II
Creator II
Author

Thanks John!

Devang,

The test qvw is throwing out an error. Are the functions array() and MultipleFieldSearch() valid functions?

I tried looking up the APi for both 8.5/9.0, but coudn't trace them?

Thanks,

Siddharth