This is a public Forum  publicRSS

Topic

    Kumari Lavanya
    Asset status not getting updated through SOAP
    Topic posted January 30, 2017 by Kumari LavanyaRegular 
    70 Views, 6 Comments
    Title:
    Asset status not getting updated through SOAP
    Content:

    Hi,

    When I am creating Asset using SOAP request XML for creating asset, the asset is getting created but the status field is not getting updated as active even when the relevant tags and elements with correct ID is sent.

    PFB the request XML.

    Please let me know if we can stamp the status this way or not or what is the correct way to obtain the desired result.

    Thanks

    Version:
    May 2015
    Code Block:

    Answer

     

    • Jaime Grochowski

      Kumari,

      Per the documentation for the AssetStatuses object here, only the Status field is allowed for a create operation. You could try removing the StatusType field, which is read-only, from your call. If that still doesn't work, try only setting the ID or Name for the Status field instead of both. I've never worked with the Asset object myself, but hopefully one of these techniques will help.

      Jaime

    • Kumari Lavanya

      Hi Jaime,

      Thanks for your reply. I have tried the combinations like passing only Status field, only setting the ID or Name or both etc., but still the Status field is with No Value for new Assets created. I am using SOAP UI for creating assets.

      Please help me in knowing if we can get the status added this way or not or what is the correct way to obtain the desired result.

    • Edson Junior

      Hi Kumari,

      Here is a SOAP Request using update operation. However, the same idea should works for you. Look at the status field and try your self first an update to understand what is expected in the body.

      Hope this helps

      Thank you, Edson

      ---------

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
          <soapenv:Header>
              <ns7:ClientInfoHeader xmlns:ns7="urn:messages.ws.rightnow.com/v1_3" soapenv:mustUnderstand="0">
                  <ns7:AppID>Basic Update</ns7:AppID>
              </ns7:ClientInfoHeader>
              <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" mustUnderstand="1">
                  <wsse:UsernameToken>
                      <wsse:Username>xxxx</wsse:Username>
                      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxx</wsse:Password>
                  </wsse:UsernameToken>
              </wsse:Security>
          </soapenv:Header>
          <soapenv:Body>
              <ns7:Update xmlns:ns7="urn:messages.ws.rightnow.com/v1_3">
                  <ns7:RNObjects xmlns:ns4="urn:objects.ws.rightnow.com/v1_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:Asset">
                      <ID xmlns="urn:base.ws.rightnow.com/v1_3" id="1" />
                      <ns4:Name>Oracle</ns4:Name>
                   <ns4:StatusWithType>
                          <ns4:Status>
                              <Name xmlns="urn:base.ws.rightnow.com/v1_3">Unregistered</Name>
                          </ns4:Status>
                      </ns4:StatusWithType>
                  </ns7:RNObjects>
                  <ns7:ProcessingOptions>
                      <ns7:SuppressExternalEvents>false</ns7:SuppressExternalEvents>
                      <ns7:SuppressRules>false</ns7:SuppressRules>
                  </ns7:ProcessingOptions>
              </ns7:Update>
          </soapenv:Body>
      </soapenv:Envelope>

    • Pramod V

      Any updates on this Kumari? Please choose relevant answer as Best  so that it helps other community members.

      - VIP

    • Danette Beal

      Hi Kumari,

      As Pramod (thank you!!) indicated, by coming back and updating us on your progress, it adds great value to the Community. Not only can you help us as Community Managers gauge the effectiveness of the Community, but you can also help those who contributed know they've helped you with your issues. 

      Thanks in advance!!

      Danette, Community Manager

    • Kumari Lavanya

      Hi Edson,

      Thanks for your reply and sorry for responding late.

      I tried similar approach for creation of assets. Update works for me as well but the status field is "No Value" while creation :(

      Status is a NAME_ID field, so I tried the approach which I have posted above. 

      Is it that status field does not get updated until and unless the asset is created? This assumption might be wrong but would just like to clarify as I am new to Service Cloud.

      Thanks