Integrations and APIs for Service

Get Involved. Join the Conversation.

Topic

    Virginia Neal
    Value not found for element DataValue - Setting a Custom...
    Topic posted June 2, 2011 by Virginia NealGreen Ribbon: 100+ Points, last edited October 29, 2011 
    1901 Views, 18 Comments
    Title:
    Value not found for element DataValue - Setting a Custom Field When Creating an Incident
    Content:

     Using RightNow Connect I am sending an XML Object to create an Incident.  If the XML object does NOT contain any custom fields the incident is created and all is well.  As soon as I try add an element for CustomFields, the message failes with a status code 500 and the error message "RightNowSyncService|urn:wsdl.ws.rightnow.com/v1 failed Value not found for element DataValue which has minOccurs = 1 Failed in constructing object Incident : NULL input can not be deserialized Failed in setting value for element CustomFields array position 0 of object Incident Failed in constructing object CreateMsg : NULL input can not be deserialized Failed in setting value for element RNObjects array position 0 of object CreateMsg Failure in setting value for object Create element Create of type messages_ws_rightnow_com_v1::CreateMsg NULL returned from the Create deserializer due to missing or invalid XML"

    I have tried all kinds of variations when building the XML and nothing seems to work.  Can someone please take a look at the XML and see if you can spot what I might be doing wrong?

    The code block contains all the XML, but the code below is the what is causing the error:

                <s1:CustomFields>
                    <s1:GenericField name="Owner">
                       <s1:DataValue>
                        <s2:IDValue id="#owner#" />
                       </s1:DataValue>
                    </s1:GenericField>
                </s1:CustomFields>

    When the snippet above is included in the XML my attempt to create an incident fails.  When the snippet is NOT included, the incident is created just fine.

    The custom field I am trying to populate is named Owner and it contains an ID.  The value being passed is set to 80.  The attached image shows the value being passed. 

    Been fighting with this for quite awhile, so any help would be appreciated.

    Thanks

    Image:
    Code Snippet:

    Comment

    • Virginia Neal

       JUST GOT IT!!!!

      I was looking at the custom field and noted the name of the field is Owner, but the column name is owner.  The column name is all lower case, so I change the XML to c$owner and it worked!!  Final code is:

                 <s1:CustomFields dataType="NAMED_ID" name="c$owner">
                    <s3:DataValue>
                       <s3:NamedIDValue>
                        <s2:ID id='#owner#' />       
                      </s3:NamedIDValue> 
                    </s3:DataValue>
                  </s1:CustomFields>

      THANK YOU VERY MUCH!!!  You have been great help and I could not have done this without your assistance!

    • Daniel Andrews

      I see. I'm suspecting that the Owner custom field was not configured correctly. What I suggest is that you do a GetMetaDataForClass on Incident, and see whether 'c$Owner' appears in the metadata as you expect.

    • Daniel Andrews

      Oh great :) You're very welcome - feel free to bring whatever questions you have to these forums. Good luck!