Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sheet OnActivate trigger: problem with macro + select in field

I'm experiencing a problem with the OnActivate trigger on a sheet.

What I want to do is:

1. "select in field" action

2. run a macro which clears some fields (one of them being "StartDate_Year")

3. run another macro (clears some other fields)

4. "select in field" action --> sets a value in field "StartDate_Year"

But, when I switch to the sheet, action #4 is not executed

However, when I replace actions #2 and #3 by a sequence of "Clear field" actions, everything works just fine, so the problem is not in action #4.

The reason I want to use a macro, is so I can reuse this over multiple sheets.

Content of the macro is very simple:

Function ClearFields_StartDate

    ActiveDocument.Fields("StartDate_YearMonth").Clear

    ActiveDocument.Fields("StartDate_Dt").Clear

    ActiveDocument.Fields("StartDate_Day").Clear

    ActiveDocument.Fields("StartDate_Month").Clear

    ActiveDocument.Fields("StartDate_MonthShort_NL").Clear

    ActiveDocument.Fields("StartDate_MonthShort_FR").Clear

    ActiveDocument.Fields("StartDate_MonthName_NL").Clear

    ActiveDocument.Fields("StartDate_MonthName_FR").Clear

    ActiveDocument.Fields("StartDate_YearMonth_NL").Clear

    ActiveDocument.Fields("StartDate_YearMonth_FR").Clear

    ActiveDocument.Fields("StartDate_Year").Clear

End Function

(second macro is identical - with end dates)

If I comment out the last line (clearing the "StartDate_Year" field), everything also works like a charm.

So I'm having the idea that Qlikview is not executing the trigger actions in the correct order?

Has someone else experienced this problem?

I am running QV10 SR1.

thanks,

Nico

1 Reply
Bill_Britt
Former Employee
Former Employee

What happens if you move the line toward the top?

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.