Parameterized lookups - steps to create
search cancel

Parameterized lookups - steps to create

book

Article ID: 11248

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

How are Parameterized Lookups set up in Clarity? Is there an example to use to create one?

Environment

Release: All
Component: Studio Lookups

Resolution

Scenario: Bob's Shirt Shop would like to use Clarity to keep track of compatible print methods for printing names, logos and numbers on various garments. (i.e., "screen printing" or "direct to garment" work well on a towel, but a heat transfer would create a mess)

  1. Create a master object called "Garment" with an id of "garment" and Save.
  2. Create a new string attribute called "Print Method" with an id of "printmethod".
  3. Add the attribute to the properties view for the "Garment" object via [Layout: Create].
  4. Create a new lookup called "Garments" with an id of "garments". The lookup should use a dynamic query.
  5. Type in the query text:

    SELECT @SELECT:garment.name:GarmentName@
    FROM ODF_CA_GARMENT garment
    WHERE @FILTER@
    GROUP BY garment.name

    Note: In this example, the hidden key is the same as the name, since our garment to print method will have multiple mappings (hence the need for "group by")
  6. Save and Continue.
  7. Specify "garmentname" as the display attribute on the Lookup Properties: Parent Window page
  8. Save and exit.
  9. Create a new lookup called "Print Methods" with an id of "printmethods". The lookup should use a dynamic query.
  10. Type in the query text:

    SELECT @SELECT:garment.printmethod:printmethod@ FROM ODF_CA_GARMENT garment
    WHERE @FILTER@ AND     (@WHERE:PARAM:USER_DEF:STRING:GARMENT@ IS NULL OR @WHERE:PARAM:USER_DEF:STRING:GARMENT@ = garment.name)

  11. Save and Continue.
  12. Specify "printmethod" as the display attribute on the Lookup Properties: Parent Window page.
  13. Save and exit.
  14. Create a new master object called "Print Job" with an id of "printjob" and Save.
  15. Create a new attribute called "Preferred Garment" with an id of "garment".
    • Choose Data Type of Lookup. 
    • Choose Lookup of "Garments". 
    • Save.
  16. Create a new attribute called "Print Method", with an id of "printmethod"
    • Choose Data Type of Lookup.
    • Choose Lookup of "Print Methods".
    • Check value required.
    • Save.
    • Under Lookup Parameter Mappings, specify "garment" for the Lookup Parameter "garment".
    • Save again.
  17. Navigate to the Object Definition: Views page for the "Print Job" object.
  18. Add the "Preferred Garment" and "Print Method" to the properties view of the "Print Job" object.
  19. Navigate back to the properties view row, click the [Fields] link.
  20. For the "Preferred Garment" and "Print Method" fields, click the properties icon and change the Display Type to "Pull-down" and Submit.
  21. Create several instances of the Garment object:
    i.e.,
    Name: 100% Cotton T-Shirt, Id: 100c_t1, Print Method: Screen
    Name: 100% Cotton T-Shirt, Id: 100c_t2, Print Method: Direct To Garment
    Name: 100% Cotton T-Shirt, Id: 100c_t3, Print Method: Heat Transfer
    Name: 100% Cotton T-Shirt, Id: 100c_t4, Print Method: Dye Sublimation
    Name: Poly Mesh Jersey, Id: pmj1, Print Method: Screen
    Name: Poly Mesh Jersey, Id: pmj2, Print Method: Heat Transfer
    Name: 100% Cotton Towel, Id: 100c_towel1, Print Method: Screen
    Name: 100% Cotton Towel, Id: 100c_towel2, Print Method: Direct To Garment
  22. Now create an instance of the Print Job
  23. Select the garment you want to use
  24. You see that your printing options are now limited to what works with that garment type.

Additional Information

See also: Lookups master KB for Clarity