Clarity PPM

Expand all | Collapse all

Question about creating a parameterized lookup

Jump to Best Answer
  • 1.  Question about creating a parameterized lookup

    Posted 11-27-2017 09:14 PM

    Haven't done one of these in a couple of years so a bit rusty. Would appreciate any help.

     

    I need to create a parameterized lookup on sub-object B under Idea object such that it reads the records from Sub-object A for the same idea instance and displays them in a browse lookup.

     

    I had the following code in the lookup:

    select id, name from odf_ca_subobject_a

    where odf_parent_id =  @where:PARAM:XML:INTEGER:/data/odf_parent_id/@value@ 

     

    I created an attribute under sub object B, associated with this lookup, added it to create layout

    and expected to see the list of records from sub-object A but not seeing it. 

     

    I thought this code will read the odf_parent_id value from the URL of the create layout and pass it to the lookup. But evidently something is not right.

     

    What am I missing?

     

    Thanks!



  • 2.  Re: Question about creating a parameterized lookup

    Posted 11-27-2017 10:12 PM

    I don't believe this approach will work  on the Create View.  Have you pushed this attribute over to the Edit View - and does it work from the Edit View?

     

    I am also assuming when you created this new attribute, you completed the Lookup Parameter Mapping.



  • 3.  Re: Question about creating a parameterized lookup

    Posted 11-27-2017 10:34 PM

    Hi SriniVenkat ,

     

    I think your parameter syntax maybe wrong.

    The parameter syntax in NSQL is the followings.

     

    @WHERE:PARAM:USER_DEF:DATA_TYPE:PARAM_NAME@

     

    Thank you.



  • 4.  Re: Question about creating a parameterized lookup
    Best Answer

    Posted 11-29-2017 08:03 AM

    As Shoichi says the NSQL param isn't right.

    see my recent blog post

    Tech Tip: Lookup mapping - Ability to provide multi dependent lookups without saving OBS linked 

     

     

    You add this as a lookup then create a lookup attribute

    Once you've saved, you'll see the mapping for parent_id can be linked to the object internal id

     

    SELECT
    id,
    name
    FROM
    odf_ca_subobject_a
    WHERE
    odf_parent_id =  @WHERE:PARAM:USER_DEF:INTEGER:parent_id@


  • 5.  Re: Question about creating a parameterized lookup

    Posted 11-29-2017 12:39 PM

    Thanks so much for all your help. Indeed this approach worked - something that I'd done before but forgot over the years.