10 Replies Latest reply on May 9, 2017 8:45 AM by polinao RSS
    cjones-2 Newbie

    7.4 platform getID of organizations returning org name instead of ID

    We are upgrading from an older version of thingworx in which our extension used the getID method for organizations to get their IDs. Now we are upgraded to, it returns the organization Name#Organization instead of the ID.

     

    Original code:

    Organization org = OrganizationManager.getInstance().getEntity(organizationName);

        return org.getID();

     

    New 7.4 code:

        

    Organization org = (Organization) EntityUtilities.findEntity(organizationName, ThingworxRelationshipTypes.Organization);

      return org.getID();

     

    What can I change to get the organization ID in 7.4, or are IDs no longer supported in 7.4? I saw that the getID method is still available through the super but I cannot get it to return the ID.

     

    Organization org = (Organization) EntityUtilities.findEntity(organizationName, ThingworxRelationshipTypes.Organization);

      _logger.debug(org.toString());

      return org.getID();