Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2013-12-24T01:10:28Z by pdubovitsky
Adam123
Adam123
1 Post
ACCEPTED ANSWER

Pinned topic Replace Static Lists with Dynamic using API calls

‏2013-12-23T22:37:37Z |

I am trying to replace a static list with dynamic lists and will greatly appreciate any assistance. I have following code in place right now:

sub release_package_ChoiceList {
    my($fieldname) = @_;
    my @choices;
    # $fieldname as string scalar
    # @choices as string array
    # record type name is Enhancement_Request
    # field name is Release_Package
    # Start User Code
 
# Adds static list values.
@choices = GetStaticList("RELPKG", "");
 
    # End User Code 
    return @choices;
}

 

I created a dynamic list "Release_Package" and tried following but it doesn't return any values, also do i really need to hardcode the username,db etc?

$sessionObj = $entity->GetSession();

$sessionObj->UserLogon("admin","PWD","DB","SCHEMA");

$list = $sessionObj->Get
ListMembers("Release_Package");

return $list;

  • pdubovitsky
    pdubovitsky
    376 Posts
    ACCEPTED ANSWER

    Re: Replace Static Lists with Dynamic using API calls

    ‏2013-12-24T01:10:28Z  in response to Adam123

    First of all, you do not need a hook to use Dynamic list. You can just change a constant list to the dynamic list in the field properties.

    As for the code, there is no need to use "UserLogon" method. In the hook context you are already provided active session object ($session)

    Pavel