This is a public Forum  publicRSS

Topic

    Kumari Lavanya
    Custom field details not returned in SOAP requestAnswered
    Topic posted January 30, 2017 by Kumari LavanyaRegular, last edited February 1, 2017 by Danette BealElite 
    84 Views, 4 Comments
    Title:
    Custom field details not returned in SOAP request
    Content:

    Hi,

    I have created a new text custom field and added it in New Asset workspace. I am able to enter the value for the field. But when I try to query for that particular asset through then the custom field details are not returned.

    I want to know the tag element of the newly created custom field so that the field value can be passed through the API while creating the new assets through SOA.

    Please let me know if we need to modify the API explicitly for the custom fields.

    Please help me with the solution regarding the same.

    Below is the xml I used:

    Version:
    May 2015
    Code Block:

    Best Answer

    Edson Junior

    Kumari,

    Look the error msg in your SOAP Response. It says "Selected column is not an object: Parent_Product". As Dietrik said you might be using a wrong column name.

    In addition, let me share a tip that works for me. There is a public tool which calls CXDev Toolbox (you can find in this link http://toolbox.cxdeveloper.com/). It is a free tools created by someone who wants to help our OSvC community. During the project implementation I’ve been used to help me in the data mapping or even to understand the data model. 

    Use this tools to test your queries and find the right column name. Ex.:

    You can type “describe asset”, and you gonna find the asset definition.

    You can type “describe Asset.CustomFields”, and you gonna find the Custom Fields. Noticed I’ve used the information resulted at the column path from the first describe I did.

    Also you can see the SOAP Request and SOAP Response.

    It might be helpful during the project implementation, specially to complete you data mapping.

    Hope its help.

    Thank you, Edson 

    Answer

     

    • Edson Junior

      Kumari,

      Try it  Asset.CustomFields.Assets.A (if your field is A). Look my following example, which my custom field is Order_Number.

      -----

      <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
        <s:Header>
          <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">QueryCSV</Action>
          <h:ClientInfoHeader xmlns="urn:messages.ws.rightnow.com/v1_2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:h="urn:messages.ws.rightnow.com/v1_2">
            <AppID>Test</AppID>
          </h:ClientInfoHeader>
        </s:Header>
        <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <QueryCSV xmlns="urn:messages.ws.rightnow.com/v1_2">
            <Query>select Asset.CustomFields.Assets.Order_Number  from asset </Query>
            <PageSize>500</PageSize>
            <Delimiter>|</Delimiter>
            <ReturnRawResult>false</ReturnRawResult>
            <DisableMTOM>true</DisableMTOM>
          </QueryCSV>
        </s:Body>
      </s:Envelope>

    • Kumari Lavanya

      Hi Edson,

      Thanks for your reply. When I am querying now I get the below error: 

                  <n0:Fault>
                     <n1:exceptionCode>INVALID_REQUEST</n1:exceptionCode>
                     <n1:exceptionMessage>Selected column is not an object: Parent_Product</n1:exceptionMessage>
                  </n0:Fault>

      Note: I am using SOAP UI.

      Please let me know if we need to modify the API explicitly for the custom fields.

      My Request XML is:

      <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 Object Query</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>Lavanya</wsse:Username>
                      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">mundaneYouth2^</wsse:Password>
                  </wsse:UsernameToken>
              </wsse:Security>
          </soapenv:Header>
          <soapenv:Body>
              <ns7:QueryObjects xmlns:ns7="urn:messages.ws.rightnow.com/v1_3">
                  <ns7:Query>select Asset.CustomFields.Assets.Parent_Product  from asset A WHERE A.ID = 377;</ns7:Query>
                  <ns7:ObjectTemplates xmlns:ns4="urn:objects.ws.rightnow.com/v1_3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns4:Contact">
                      <ns4:CustomFields />
                      <ns4:Emails />
                      <ns4:Notes />
                  </ns7:ObjectTemplates>
                  <ns7:PageSize>10000</ns7:PageSize>
              </ns7:QueryObjects>
          </soapenv:Body>
      </soapenv:Envelope>

       

    • Dietrik

      Obviously the field name you're using is not right,  it should be like

      Customfields.PackageName.FieldName

      Test your query before using in the soup using the "Connect Object Explorer"

    • Edson Junior

      Kumari,

      Look the error msg in your SOAP Response. It says "Selected column is not an object: Parent_Product". As Dietrik said you might be using a wrong column name.

      In addition, let me share a tip that works for me. There is a public tool which calls CXDev Toolbox (you can find in this link http://toolbox.cxdeveloper.com/). It is a free tools created by someone who wants to help our OSvC community. During the project implementation I’ve been used to help me in the data mapping or even to understand the data model. 

      Use this tools to test your queries and find the right column name. Ex.:

      You can type “describe asset”, and you gonna find the asset definition.

      You can type “describe Asset.CustomFields”, and you gonna find the Custom Fields. Noticed I’ve used the information resulted at the column path from the first describe I did.

      Also you can see the SOAP Request and SOAP Response.

      It might be helpful during the project implementation, specially to complete you data mapping.

      Hope its help.

      Thank you, Edson