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)
Create a master object called "Garment" with an id of "garment" and Save.
Create a new string attribute called "Print Method" with an id of "printmethod".
Add the attribute to the properties view for the "Garment" object via [Layout: Create].
Create a new lookup called "Garments" with an id of "garments". The lookup should use a dynamic query.
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")
Save and Continue.
Specify "garmentname" as the display attribute on the Lookup Properties: Parent Window page
Save and exit.
Create a new lookup called "Print Methods" with an id of "printmethods". The lookup should use a dynamic query.
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)
Save and Continue.
Specify "printmethod" as the display attribute on the Lookup Properties: Parent Window page.
Save and exit.
Create a new master object called "Print Job" with an id of "printjob" and Save.
Create a new attribute called "Preferred Garment" with an id of "garment".
Choose Data Type of Lookup.
Choose Lookup of "Garments".
Save.
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.
Navigate to the Object Definition: Views page for the "Print Job" object.
Add the "Preferred Garment" and "Print Method" to the properties view of the "Print Job" object.
Navigate back to the properties view row, click the [Fields] link.
For the "Preferred Garment" and "Print Method" fields, click the properties icon and change the Display Type to "Pull-down" and Submit.
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
Now create an instance of the Print Job
Select the garment you want to use
You see that your printing options are now limited to what works with that garment type.