0

I'm trying to define a LOV with Universe Designer that when used in a @Prompt shows the user the item description, but gives back the corresponding item key as result of user selection.

e.g. From a dimension table of countries with two columns as COUNTRY_ISO and COUNTRY_NAME, I would like to show COUNTRY_NAME values to user with @prompt, but get back the corresponding COUNTRY_ISO as return value of @prompt.

1 Answer 1

0

This is possible using Index Awareness. I'll describe the solution using the sample "Island Resorts Marketing" universe, but the concept should map to your specific need.

For this example, we'll create a prompt on the "Country" object in the "Resort" class. The prompt will display the country names, but the condition will apply to the country_id field.

First, we need to identify the keys. On the Keys tab of the Resort\Country object, add a new Primary Key using Resort_Country.country_id as the source:

enter image description here

(in your case, you'll do this on the COUNTRY_NAME object, using COUNTRY_ISO as the primary key)

Next, we create the predefined condition that will include the prompt. Create a new Predefined Condition, named "Select country", with the following definition:

Resort_Country.country_id = @Prompt('Choose a country','A','Resort\Country',Mono,primary_key)

What we're doing is is applying the condition to the ID field (resort_country.country_id), but using the country name (the Country object) as the source. Note the "primary_key" parameter -- this tells BO to use the PK from the referenced object.

Now to test. Create a WebI report and select the "Select country" filter along with a field to display. I chose Service Line:

enter image description here

I run the report and am presented with a list of country names. I choose France, and I get a list of the Service Lines associated with France. The SQL generated by this query, reflecting my prompt selection, is:

SELECT
  Service_Line.service_line
FROM
  Service_Line,
  Country  Resort_Country,
  Resort
WHERE
  ( Resort_Country.country_id=Resort.country_id  )
  AND  ( Resort.resort_id=Service_Line.resort_id  )
  AND  ( Resort_Country.country_id = 2  )

Note the very last line, which shows that the condition is applied using the ID, even though I selected the country name "France".

References:
- XI3.1 Designer Guide @Prompt info, starting on page 520
- Dave's blog on Index Awareness
- Dave's blog on Index Awareness with prompts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.