Clarity

  • 1.  How to get value from a dynamic lookup field

    Posted Sep 29, 2015 08:14 AM

    Hi all,

     

    I've created a field in the project object with as a dynamic lookup.  The query is simple select state, zip code, region area from a custom database table X.

    I need to find out the value once the user make their selection.

    I need to update the project name with the combination of region_zipcode based on the user selection.  I can't seem to get the value out of this dynamic lookup field to try to do an update.

    Suggestion please!

     

    Thanks,

     

    Tai



  • 2.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 08:34 AM

    Not sure I really understand what it is you are trying to do...

     

    If you are trying to get the user to select something from a list and then automatically change some other value based on that selection, then the way to do this would be via a process ; user selects the list-value, process starts and updates (via GEL/XOG) the object to change the value.

     

    If I am misunderstanding your use-case, perhaps you could explain more / add some screen shots ???



  • 3.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 08:52 AM

    Hi Dave,

     

    So basically the Region field is a dynamic lookup field.  The user selected Acton as a region, I'll write a gel script to update the Project Name to Region_name_ZipCode based on this selection.  My issue for now, I'm having problem getting the Acton value from the Region field for this project.  I've been getting Null value from my query.

     

    Hopes that explain it.

     

    Thanks,

     

    Tai



  • 4.  Re: How to get value from a dynamic lookup field
    Best Answer

    Posted Sep 29, 2015 09:03 AM

    Ok - but since I can't see your query, all I would say is that since this is a dynamic query-lookup, all you should need to do is use the same "parameter" (that you have mapped in the object to the dynamic lookup) in some 'normal SQL' and you should get the same 'value'.

     

    Not sure why (from a functional point-of-view) you are needing to do all this though - I'd be inclined to either generate the projects with the right names in the first place OR protect (enter-once) the 'Region' field and just leave it as an attribute of the project OR just get the user to enter the right name first off - but hey its not my application is it!



  • 5.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 09:10 AM

    That was my initial thought about updating a project name since any project manager can surely enter a project name :-)

    I was not able to convince them otherwise so I'm struggling through this.

    Thanks for the suggestion Dave.

     

    Tai



  • 6.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 09:22 AM

    You can protect project-nane (make it enter-once) - OWB would circumvent that though (i.e. a user could still change it in OWB) - but of course protecting project-name might only make sense under certain circumstances.



  • 7.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 11:46 AM

    Hi Dave,

     

    Can you see what I did wrong here.  I've changed course and go with a static dependent list.

     

    select inv.name, odf.nt_wire_center_st,(select NAME from clar142.cmn_lookups_v
    where lookup_type ='CLLI_CD'
    and lookup_code = 'odf.nt_wire_center_st'
    and language_code = 'en') CLLI_NAME,
    (select parent_lookup_code from clar142.cmn_lookups_v
    where lookup_type ='CLLI_ID'
    and lookup_code = 'odf.nt_wire_center_st'
    and language_code ='en') CLLI_P_ID,
    (select NAME from clar142.cmn_lookups_v where
    lookup_type ='NT_WIRE_CENTER'
    and lookup_code = (select parent_lookup_code from clar142.cmn_lookups_v
    where lookup_type ='CLLI_ID'
    and language_code = 'en'
    and lookup_code ='odf.nt_wire_center_st')) Wire_Name

    from clar142.inv_investments inv, clar142.odf_ca_project odf
    where inv.id=odf.id
    and inv.name ='Tai Test Project'

     

    CLLI_NAME, CLLI_P_ID, and Wire_Name came back null

     

    CLLI_ID is the level 2 lookup ID

    and NT_WIRE_CENTER is the level 1 lookup ID

    where nt_wiere_center_st is the attribute ID

     

    Thanks,

    Tai



  • 8.  Re: How to get value from a dynamic lookup field

    Posted Sep 29, 2015 11:53 AM

    You are passing a literal-string into the sub-selects for the lookup values rather than a column-value.

     

    i.e. you have and lookup_code = 'odf.nt_wire_center_st'

     

    where you should have and lookup_code = odf.nt_wire_center_st

    (i.e. no quotes!)