BusinessObjects Board

Prompt Value In LOV Query

Hello All :slight_smile: ,

Is it possible to set the value of a prompt which is used in a LOV to some specific value before the LOV is displayed on the screen using SDK :?: :?:

Thanks & Regards,
Sri
:crazy_face:


Sridharan :india: (BOB member since 2002-11-08)

Hello Sri,

Do you want to set the value of a prompt automatically so the user won’t have to do it, or do you want to see the prompt displayed with the value already filled?


Olivier Masse :fr: (BOB member since 2002-08-29)

This is the code that we use to default prompt values. Note that the defaults are only populated if a value has not previously been chosen.

Private Sub Document_BeforeRefresh(Cancel As Boolean)
'Previously chosen prompt values are stored in variables at the document level.
'This routine sets defaults if the prompts have no previously chosen value.
'Look at the first character of prompt text (the variable name) and:
'   3 = Scale (default 1000)
'   4 = Cost Center (default ALL)
'   5 = Profit Center (default ALL)
'   6 = Client (default ALL)

    Dim Var As Variable

    For Each Var In ThisDocument.Variables
        If Var.IsUserPrompt = True And Var.Value = "" Then
            Select Case Left(Var.Name, 1)
                Case "3"
                    Var.Value = "1000"
                Case "4", "5", "6"
                    Var.Value = "ALL"
            End Select
        End If
    Next Var

End Sub

Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi Olivier,

I want to set the value of a prompt in a LOV so that the user won’t have to do it. Any ideas :idea: .

Dwayne,

That code will set the prompt value at the Query Panel. I doesn’t set the prompt value in a LOV. Does it :?:

Thanks

Sridharan


Sridharan :india: (BOB member since 2002-11-08)

I’m a little confused :confused: . My understanding is that a prompt is used “somewhat” independently of the LOV. What I mean is that a prompt can be filled in (if not defined as constrained of course) without using the Values… button and the LOV. That is true whether the prompt is from a universe object, or created directly in the query panel. Conversely, LOVs can be used without a prompt, like in the query panel while building conditions.

My code above sets the default for the prompt. If you are looking to have a LOV “pre-filled” with values (without refreshing) then that is a function of Designer, not SDK. Two options. First, you can hardcode the list as part of the object definition. Second option is to get the LOV “like you want it” and then in Designer set the properties on the associated object as follows:
Deselect “Allow users to edit this list of values”
Deselect “Automatic refresh before use”
Select “Export with universe”

Hope this helps.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi Dwayne :slight_smile: ,

Yes one can set the value of the prompt through SDK. But let me put down my requirement.

I have a LOV which has a prompt to restrict the values displayed for selection. Now basically what I would like to do is I want to take the value from a prompt defined in the Query Panel and pass that value to the Prompt which is in the LOV query so that when the LOV shows the user doesn’t have to enter the value instead he is presented with limited set of values.

Hope this is clear.

Regards,
Sri


Sridharan :india: (BOB member since 2002-11-08)

Yes, that is much more clear. It sounds like the classic “cascading prompt” requirement, and if you will do a search here on BOB for that phrase you will find many discussions. As far as using the SDK to overcome some of the limitations of cascading prompts (at least perceived by some as limitations), I just don’t think the object model is robust enough to help. You would need some kind of “after LOV” event, which of course doesn’t exist.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Hi Dwayne,

It is not the classic “Cascading Prompt” requirement even though it looks like one. In my case I want the prompt to be part of the Query itself as well as restrict the LOV value taking the value entered at the query panel. Is that possible :?: :?: .

Regards,
Sri


Sridharan :india: (BOB member since 2002-11-08)