Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Michael Wigley
    [Java] Retrieve OrganizationServiceSettings via SOAPAnswered
    Topic posted April 9, 2018 by Michael WigleyGreen Ribbon: 100+ Points, last edited April 10, 2018 
    33 Views, 1 Comment
    Title:
    [Java] Retrieve OrganizationServiceSettings via SOAP
    Content:

    I'm having a difficult time 'get'ing the OrganizationServiceSetting data.

    I've done similar with getting the custom fields but when I get the populated object back, the OrganizationServiceSettings is always null and the tracking variable is set to false.
     
    There must clearly be something I'm missing, any direction would be greatly appreciated. 
    Version:
    Connect Web Services 17d
    Code Snippet:

    Best Comment

    Michael Wigley

    From my observations one must also populate the SLAInstanceList:

    SLAInstanceList slainstances = new SLAInstanceList();

    OrganizationServiceSettings oss = new OrganizationServiceSettings();

    oss.setSLAInstances(slainstances);
     
    ID id = new ID();
    id.setId(orgid);
     
    Organization org = new Organization();
    org.setID(id);
    org.setServiceSettings(oss);
     
    orgs[0] = org;

    try
    {
        RNObjectsResult getResults = _rightnow.getService().get(orgs, _rightnow.getGetOptions(), _rightnow.getClientInfo(), apiAccessReqeustHeader);

        orgs = getResults.getRNObjects();
        org = (Organization) orgs[0];
    }
    catch (RemoteException | RequestErrorFault | APIAccessErrorFault | UnexpectedErrorFault | ServerErrorFault | RequestErrorFaultDetail e)
    {
        e.printStackTrace();
    }

     

    Be careful that the organization id that you are getting actually has an item in it's SLAInstance list, otherwise it appears to return null for the entire ServiceSettings and not just an empty SLAInstanceList.

     If there are others out there that know more and can fill in any gaps to my understanding, it would be greatly appreciated.

    Comment

     

    • Michael Wigley

      From my observations one must also populate the SLAInstanceList:

      SLAInstanceList slainstances = new SLAInstanceList();

      OrganizationServiceSettings oss = new OrganizationServiceSettings();

      oss.setSLAInstances(slainstances);
       
      ID id = new ID();
      id.setId(orgid);
       
      Organization org = new Organization();
      org.setID(id);
      org.setServiceSettings(oss);
       
      orgs[0] = org;

      try
      {
          RNObjectsResult getResults = _rightnow.getService().get(orgs, _rightnow.getGetOptions(), _rightnow.getClientInfo(), apiAccessReqeustHeader);

          orgs = getResults.getRNObjects();
          org = (Organization) orgs[0];
      }
      catch (RemoteException | RequestErrorFault | APIAccessErrorFault | UnexpectedErrorFault | ServerErrorFault | RequestErrorFaultDetail e)
      {
          e.printStackTrace();
      }

       

      Be careful that the organization id that you are getting actually has an item in it's SLAInstance list, otherwise it appears to return null for the entire ServiceSettings and not just an empty SLAInstanceList.

       If there are others out there that know more and can fill in any gaps to my understanding, it would be greatly appreciated.