Customer Portal

Get Involved. Join the Conversation.

Topic

    Kalaimagal Eswaran
    Custom Field MenuAnswered
    Topic posted July 9, 2015 by Kalaimagal EswaranBlue Ribbon: 750+ Points 
    426 Views, 4 Comments
    Title:
    Custom Field Menu
    Content:

    Hi,

    How can I get Custom field's Menu ID & Value using ROQL or some other way in CP?

     

    Thanks,

    Kalai Eswar

    Best Comment

    Nisar

    Hi Kalaimagal,

    You can use the following to fetch the IDs and Values:

    $menuItemValues = RightNow\Connect\v1_2\ConnectAPI::getNamedValues("RightNow\\Connect\\v1_2\\Incident.CustomFields.c.custom_field_name"); 
    

    Comment

     

    • Nisar

      Hi Kalaimagal,

      You can use the following to fetch the IDs and Values:

      $menuItemValues = RightNow\Connect\v1_2\ConnectAPI::getNamedValues("RightNow\\Connect\\v1_2\\Incident.CustomFields.c.custom_field_name"); 
      
    • Rajan Davis

      For some reason, when I run something like the above code, it always returns null values for both the LookupName and ID.

      Am I missing something? Running a ROQL query to get the values of a menu is too slow (3 - 4 seconds); however, running a report for the same thing run slows the first time (3 - 4 seconds) and the values are returned under a second for each subsequent request.

    • Nisar

      Hi Rajan,



      Are you sure the values returned are null? I think what you're coming across is "lazy loading". Refer to Scott's comment here.

    • Rajan Davis

      Thanks for linking to that post; I didn't realize I had to explicitly specify the attributes from the object.

      Not sure if anyone cares, but the throughput on using this method is significantly faster than using a report or a ROQL query.

      Here's a code example of how to use the method above: