Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue when running a macro

Hi,

I have a requirement where I need to force an always one selected value but I need to clear it as soon as I leave the sheet. I found a macro on Qlikview community which is doing my job. The macro is below

sub alwaysoneselect

set qvobj = ActiveDocument.GetSheetObject("LB427")

set myfield = qvobj.GetField

set fieldprop = myfield.GetProperties

    fieldprop.OneAndOnlyOne =  true

    myfield.setproperties fieldprop

end sub

sub removeoneselected

set qvobj = activedocument.getsheetobject("LB427")

set myfield = qvobj.getfield

set fieldprop = myfield.getproperties

    fieldprop.OneAndOnlyOne =  false

    myfield.setproperties fieldprop

    ActiveDocument.ClearAll true

end sub

I call the alwaysoneselect macro on activation the sheet and call removeoneselected on leave the sheet.

The macro is working wonderful on using qlikview desktop. However the same macro is not working when I use it qlikview server and access it on access point through my browser

I have allowed system acces on qlikview desktop  and allows unsafe macro execution on server

system access.PNG

allow macro.PNG

Can someone please help me how to fix this

Syed

2 Replies
jerrysvensson
Partner - Specialist II
Partner - Specialist II

Sheet triggers only works when you use plugin as client.

Using Ajax client it will not work, have a look at triggers in the reference manual.

marcus_sommer

Possibly it works with a variable / several variables as trigger (OnChange):

varSheet = if(GetActiveSheetId() = 'SH01', 'select', 'deselect')

- Marcus