Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Welcome to our newly redesigned Qlik Community! Read our blog to learn about all the new updates: READ BLOG and REPORTED ISSUES
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem in macro

Hi,

Im using a macro to set 'Always one selected' Property for a listbox.

For eg: 'Currency' Field

In one Tab, 'Currency' Field should have default selection as 'Euro' and the same field should be cleared in another sheet (No value selected).

It was working in my development environment , But not in the accesspoint. Please let me clear what may be the problem

Im using the following macro:

Sub Select
ActiveDocument.Fields("Currency").Select "EURO"
set fld1 = ActiveDocument.GetField("Currency")
set fprop1 = fld1.GetProperties
fprop1.OneAndOnlyOne = true
fld1.SetProperties fprop1
End Sub

Sub Clear
set fld = ActiveDocument.GetField("Currency")
set fprop = fld.GetProperties
fprop.OneAndOnlyOne = False
fld.SetProperties fprop
ActiveDocument.ClearAll
End Sub

First macro in one sheet , for the default selection and second one for clearing the macro

It was not working in the accesspoint

Can anyone help me in this? where Im doing wrong...

Thanks in advance,

Dhoulath

11 Replies
Creator
Creator

Hi,

I am facing the same issue. Did u get solution for this?.

Please share with me.

Thanks,

Durai.

Not applicable

Have you enabled macros while it was asking you to enable it first time.

Whenever there is macros in file, at client it asks to enable macros. Enable all macros.

Hope it will help you.

Specialist II
Specialist II

If u read the Limitaion of Using macro in Server it is mentioned that the macro will not work when u call it on

activation of sheet

Creator
Creator

Hi,

I enabled macros. Actually, its working fine on Qv9 version. Recently we have upgraded to Qv10Sr3 version. After that only, its not supporting. Even if you trigger the macro through button also not working. In the same application all macros are working fine when we open in desktop version. The issue is happening when we access the app from server. Especially the "AlwaysOneSelected Value" is not happening.

Thanks,

Durai.

Not applicable

Seems to be a problem in QV10 SR3. We have the same system environment and OneAndOnlyOne = true is not working - even if i put it on a button.

MVP & Luminary
MVP & Luminary

Hi,

   If you look at the API it is been stated that whenever you use the "OneAndOnlyOne" property, that must be used with ShowAlternative property.

   Here is the sample code.

set fld=ActiveDocument.GetField("Class")

if fld.GetValueCount(1) = 1 then

    set fprop = fld.GetProperties

    fprop.ShowAlternatives = false

    fprop.OneAndOnlyOne = true

    fld.SetProperties fprop

end if

Regards,

Kaushik Solanki

Regards,
Kaushik
If reply is satisfactory, please "Like" the post.
If reply is solution, please mark as "Correct".
Not applicable

Hi Kaushik,

thanks for your answer. I tried to work with your idea, but the macro still is not working. The only difference between using ShowAlternative or not is, that all not selected values are marked yellow. But you still can markup more than one value or markup no value (even if OneandOnly is set to true).

Regards, Martin

Not applicable

Is there a solution for this bug in QV10 SR4 or in QV11?

Not applicable

I have the same problem. It works fine in the desktop environtment, but it doesn't work in the accesspoint.

What I have discovered is that when you save the document from the desktop be sure that the "oneandonlyone" property is set to false. If you set the "oneandonlyone" property to true and you save the document, then you are not able to change the property with a macro in the accesspoint.