Forums

Forums / Developing Portals / TPC Form - Lookup - fetch more attributes than the ID and display Attribute

TPC Form - Lookup - fetch more attributes than the ID and display Attribute

6 posts, 1 answered
  1. Missing user
    Missing user avatar
    15 May 2023
    Link to this post
    On lookup fetchxml we can add more attribute to the xml but I want to know how to reteive those Attrributes using JS or whatever to get them populate to the user instead of using saved queries
  2. Missing user
    Missing user avatar
    15 May 2023 in reply to Missing user
    Link to this post
    Kerillos - are you looking to filter the lookup values based on logged in user? 
  3. Missing user
    Missing user avatar
    16 May 2023 in reply to Missing user
    Link to this post
    No, I'm not asking on the filteration I'm asking if we could use the lookup Fetchxml to get more attributes of that entity we lookup into it? 
  4. Missing user
    Missing user avatar
    16 May 2023 in reply to Missing user
    Link to this post
    Hi Kerillos,

    You can add additional attributes to the fetch manually by clicking build or changing the xml text directly to add the attribute.

    Tom
  5. Missing user
    Missing user avatar
    16 May 2023 in reply to Missing user
    Link to this post
    Yes, I already done this I have added more attributes to the Lookup Fetchxml  but I couldn't figure out how can I get those attribute Using TPC APIs , 
    Ex,  tpc.forms[0].Lookup.get_value() this retarun only it's Guid 
  6. Adam Benoit
    Adam Benoit avatar
    23 posts
    Registered:
    01 Mar 2017
    Answered
    17 May 2023 in reply to Missing user
    Link to this post
    Hi Kerillos,

    You need to get the selected dataItem to get the additional attributes:

    tpc.forms[0].<YOUR LOOKUP>.get_kendoInput().dataItem()

    This will return an object with all the attributes from the FetchXML.

    Hopefully this helps,

    Adam
6 posts, 1 answered