Clarity

Expand all | Collapse all

Not able to see multivalued lookup attribute in Portlet, built using the O

  • 1.  Not able to see multivalued lookup attribute in Portlet, built using the O

    Posted Mar 01, 2010 06:05 AM
    Hi,       One portlet built using an Object. My requirement is to add one attribute(which is of multivalued lookup) to be available on the  portlet. When i am checking in the "Available" section of portlet i am able see all object related attributes except this  attribute. Just wondering can't we pull multivalued lookup attributes in the portlet built using  an object instead of NSQL.  I am thinking either to rebuilt the entire portlet using NSQL query. Is there any option or way to show up that attribute in the portlet without using NSQL.  Really appreciate for the help.  Thanks & Regards,Rekha.


  • 2.  Re: Not able to see multivalued lookup attribute in Portlet, built using t

    Posted Mar 01, 2010 06:23 AM
    Hi Rekha,                   The multivalue lookups is stored in "ODF_MULTI_VALUED_LOOKUPS" table. Not in ODF_CA_ .   You can display the attributes values in portlet, whatever the data having in master & custom tables based on the object portlet. if you want to display the values include multivalued lookups in portlet, you have to build the NSQL Portlet based on the requirements. You can displaying the data  with multivalued lookups(Using Function)  in one row with NSQL Poprtlet.    ThanksSenthil.


  • 3.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Oct 02, 2012 12:08 AM
    Hi Senthi,

    You mentioned "You can displaying the data with multivalued lookups(Using Function) in one row with NSQL Poprtlet."
    Can you please provide some details about this function?

    I have concatenated lookup results into a string but I am facing issues as the concatenated string is too large in size for some instances as the Multi Lookup can have upto 50 entries.

    Dave, I'll try and look for the examples you mentioned about how to "flatten" values into a single column.


  • 4.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 01, 2012 07:19 AM
    Hi Jimmy,

    Please let me know the database which clarity using?


    is it oracle or sql server?


    Thanks
    Senthi Arul


  • 5.  Re: Not able to see multivalued lookup attribute in Portlet, built using t

    Posted Mar 01, 2010 06:25 AM
    Your problem becomes a conceptual one.... how do you want the multi-values to be displayed in your portlet?  Consider an instance of an object which has a multi-valued-attribute containin 999 entries....   you build your portlet to return the 1 instance of your object, but how do you want to display the 999 multi-valued attributes?   Is that 999 lines in your portlet (unlikely) or 1 line with a formatted column containing all 999 values (possibly), or 1 line with a detail drill down portlet to show the 999 values (possibly), or 1 line that links to the underlying object (where the 999 values will just be seen in the attribute itself) - the latter is probably the best option (and is what Clarity is giving you by default).  Anything other than this default and YOU are having to make (functional/business) decisions about how the portlet needs to work and then YOU are going to have to "code" that - in NSQL (etc).  There are some NSQL expamples on this board about how to "flatten" values into a single column if I recall correctly.  ....or build a report instead?    Dave.    EDIT : Senthil got in there first! Pah!   :-) Message Edited by Dave on 01-03-2010 04:30 PM [left]


  • 6.  Re: Not able to see multivalued lookup attribute in Portlet, built using t

    Posted Mar 01, 2010 06:35 AM
    Hi Dave and Senthil,     Thanks for the reply.  Already I have  modified one portlet using nsql and added this multivalued attribute in the query, used a function which concatenates the multiple values for that attribute.Why  i asked this question is,  I have    requirement to modify 3 portlets similar to this portlet.  Means i have to rebuilt  all the existing  portlets again using NSQL query?  Thanks & Regards,Rekha.  


  • 7.  Re: Not able to see multivalued lookup attribute in Portlet, built using t

    Posted Mar 01, 2010 06:57 AM
    So that would be "yes you have to do that in NSQL" - which if your existing portlets are just object-based will be a re-write for you - sorry!   :-(  Warning that you can "lose functionality" doing this; since you can not update data ("Edit mode") directly through NSQL portlets - that may be a concern for your users?    


  • 8.  Re: Not able to see multivalued lookup attribute in Portlet, built using t

    Posted Mar 01, 2010 07:59 AM
    Dave,   Thanks for telling me the about the "Edit mode" functionality. I don't know about this.  Thanks & Regards,Rekha.


  • 9.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 14, 2011 08:24 AM
    what if we need to filter values based on the multi-valued lookup ? How can that be achieved ?

    Regards
    NJ


  • 10.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin
    Best Answer

    Posted Nov 14, 2011 01:13 PM

    navzjoshi00 wrote:

    what if we need to filter values based on the multi-valued lookup ?
    You can "code" it in your NSQL using a user-provided parameter field.


  • 11.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 01, 2012 02:19 PM
    Hi NJ,

    You can do that by using the below code to use multi select lookup as filter field but in that case that filter would not allow the multI-value selection, I am sure there must be way but so far I did not try that as our requirement was just to give single select as filter field rather than multi select.

    AND
    (
    @where:param:user_def:string:param_prj_list@ is null or
    (APM.IDEA_ID in (select pk_id FROM odf_multi_valued_lookups
    WHERE object = 'idea'
    AND attribute = 'ahm_pmo_projectlist' and value in (@where:param:user_def:string:param_prj_list@))))


    Shalinee


  • 12.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 01, 2012 06:58 PM
    Thanks Shalinee for the reply.

    Senthi, we are using Oracle db. I have used the following function which works fine except it retrieves the lookup code instead of the name.

    FED_FLATTEN_MVLOOKUPS_FCT('project', PROJECT_DB_ID, 'release_type', ', ')

    Is that the one you were referring to?

    Regards
    Jimmy


  • 13.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 01, 2012 07:21 PM
    Has anyone implemented multivalued look up type attribute of SR/Project or nay Object as a filter field of NSQL type portlet with option of multi-select in port;et filter field.

    As I have noticed we can do the same by using the parameter type attribute in NSQL but in that the lookup is not giving the option to do multi-select.


    Also I have gone through the older post and found this like which is exactly talking the same stuff.
    12766369

    We are on CA 12.0.4.


    Can anyone confirm ....is this working in V13 as we can make MVL type look attribute require in V13 ?

    Thanks,
    Shalinee


  • 14.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 05, 2012 03:24 AM
    Hi,

    Please look at the sample code which will get multiple value in to single value (i.e concatenated)


    SELECT INV.CODE, INV.NAME, MVL.FULL_NAME FROM INV_INVESTMENTS INV JOIN
    (SELECT PK_ID,
    listagg (FULL_NAME, ',') WITHIN GROUP (ORDER BY FULL_NAME)
    FULL_NAME
    FROM ODF_MULTI_VALUED_LOOKUPS MVL JOIN SRM_RESOURCES SRM ON SRM.ID = MVL.VALUE AND ATTRIBUTE = 'test'
    GROUP BY PK_ID) MVL ON INV.ID = MVL.PK_ID

    Thanks
    Senthi Arul


  • 15.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 05, 2012 01:55 PM
    Thanks Senthi,

    I am not sure if I understand your example. My question is - Can we use a multivalued look up type attribute of any object as multivalued filter field in a NSQL portlet.

    He is example--

    Example- In our Idea Object I have a field "A" with Multivalued Look-up type. Now, we wrote a query to fetch that multivalued look-up as filter field in NSQL Type using user_def parameter as below query. After that we added the same look-up type with parametrized query attribute as used in my Idea object.

    AND
    (
    @where:param:user_def:string:param_prj_list@ is null or
    (APM.IDEA_ID in (select pk_id FROM odf_multi_valued_lookups
    WHERE object = 'idea'
    AND attribute = 'ahm_pmo_projectlist' and value in (@where:param:user_def:string:param_prj_list@))))

    Now when we am looking over the portlet filter fields option, IO am not able to make it that parametrized NSQL attribute in multivalued.


    Shalinee


  • 16.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 05, 2012 11:32 PM
    Hi Shalinee ,

    Multi - Select option will be avaliable for the Portlet column whatever defined in the NSQL.

    The multi-select option will not be available, if NSQL having param construct on the Query.


    But it's possible to achive it.

    Thanks
    Senthi Arul


  • 17.  Re: RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Mar 12, 2015 09:14 PM

    Hi all..

    I am also facing the similar issue .

    can anyone help..how to pass multivalues lookup in a query . Second how to make that field as multilookup in filter section.

     

    Priya



  • 18.  RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Nov 06, 2012 03:54 AM

    shalinee wrote:

    My question is - Can we use a multivalued look up type attribute of any object as multivalued filter field in a NSQL portlet.
    Just to backup Senthil;

    1) for a simple field returned by your query, that you choose to also use as a filter field ; YES this is simple, you can just choose to implement multi-select

    2) for a @PARAM@ field, then this is complicated, under some circumstances it works OK, others (UNIONs?) it fails. Rob Ensinger did a lot of investigation around this a while back - see here ; Multi-select on an NSQL Parameter?


  • 19.  Re: RE: Re: Not able to see multivalued lookup attribute in Portlet, built usin

    Posted Jul 09, 2015 10:46 AM

    Slightly off topic but want to add this here to help the next forum traveler. My business problem to solve is to return a comma separated concatenated list of values from a multivalue attribute on the project object. That FED_FLATTEN_MVLOOKUPS_FCT function is pretty worthless...

     

    Thanks Senthi for the Oracle example using listagg. I'm MSSQL, so no listagg for us but this put me on the right path. The best solution I've found for MSSQL is the FOR XML clause.  Code sample and results below.

     

    SELECT
    INV.NAME
    , INV.CODE
    , MVL_CONCAT.AUDIENCE
    FROM INV_INVESTMENTS INV
    LEFT JOIN (SELECT PK_ID , STUFF(( SELECT  ', '+ (SELECT LOOKUP.NAME FROM CMN_LOOKUPS_V LOOKUP WHERE LOOKUP.LANGUAGE_CODE = 'en' AND LOOKUP.LOOKUP_CODE = MVL1.VALUE AND LOOKUP.LOOKUP_TYPE = 'OSUWMC_AUDIENCE')
      FROM ODF_MULTI_VALUED_LOOKUPS MVL1
      WHERE MVL2.PK_ID = MVL1.PK_ID FOR XML PATH('')),1 ,1, '')  Audience
    FROM ODF_MULTI_VALUED_LOOKUPS MVL2
    WHERE MVL2.OBJECT = 'project'
    AND MVL2.ATTRIBUTE = 'osuwmc_audience'
    GROUP BY PK_ID) MVL_CONCAT ON MVL_CONCAT.PK_ID = INV.ID
    WHERE MVL_CONCAT.AUDIENCE IS NOT NULL
    
    
    

    concatenated_mvl_results.jpg

     

    Thanks again to all here who keep the lights on, contribute and make all this Community Forum stuff happen. **KAPOW!**  Another solution... delivered.


    Ideally, we simply need a function similar to FED_FLATTEN_MVLOOKUPS_FCT that returns the language appropriate NAME values.

    Please vote up the Idea Database Function for Comma Separated MultiValue Lookup Name Results if you believe this would provide your organization value.


    HTH the next traveler.

    Rob