This is a public Forum  publicRSS

Topic

    Farhad Pagdiwala
    Unable to update Customer Address containing a NamedID...
    Topic posted August 2, 2017 by Farhad PagdiwalaJourneyer, last edited August 11, 2017 
    99 Views, 10 Comments
    Title:
    Unable to update Customer Address containing a NamedID element.
    Content:

    We are having issue while updating CustomerAddress object, which is a custom object.

    The web service is returning the below error.

    SOAP fault from Item: RightNowSyncService|urn:wsdl.ws.rightnow.com/v1_3 failed
    Found out-of-order or unrecognized node while parsing node of type DataValue|urn:generic.ws.rightnow.com/v1_3
    NULL value is set to a non-nillable element GenericFields of object GenericObject
    Failed in setting value for element GenericFields array position 0 of object GenericObject
    NULL value is set to a non-nillable element RNObjects of object UpdateMsg
    Failed in setting value for element RNObjects array position 0 of object UpdateMsg
    NULL value is set to a non-nillable element Update of object Update 
    NULL returned from the Update deserializer due to missing or invalid XML

    This object contains a NamedID type field called Purpose, which stores a value 1 = Bill_To or 2 = Ship_To based on Menu Option.

    Can anyone please guide me as to how the XML payload should be designed so that it can update the NAMED_ID object element.

    Version:
    Oracle Service Cloud August 2016 (Build 619 SP 5, CP 619)

    Answer

     

    • Pramod Vasudeva Murthy

      PFA sample code. In my case:

      Parent Object: Incident

      Menu only object name: test_menu_only_co

      I have shared samples on setting this using both Name and IDs. Replicate the same for Contact.

      ~VIP

    • Farhad Pagdiwala

      Thank you Pramod for guiding me and for the sample XML SOAP payload files.

       With regards to the sample file where it's been updated using ID for NAMED_ID type field, I've a few questions.

      1. Since I need to update the Custom object (CustomerAddress), do I need to have CustomFields tag?

      2. In the GenericFields tag, the name is set  to "CO". I believe, this is the name of package. Is that correct? I

              a. f yes, then you're again adding the custom object IncidentCustomFields with Namespace and TypeName tags, why is that?

              b. Do you've a custom package called IncidentCustomFields and custom object called IncidentCustomFields as well?

              c. I would think that the typename should be test_menu_only_co object?

              I'm trying to wrap my thinking  around your sample XML payload format. So, please guide me here.

      Thanks,

      Farhad.

    • Pramod Vasudeva Murthy

      Thanks for your questions, 

      I have provided an example of Standard object to Custom only menu object linking. So if I understand is CustomerAddress and Purpose is a menu ID field and you say that the object is residing in "CO" package.

      Please correct me if I understand wrong.

      ~VIP

    • Farhad Pagdiwala

      Yes, you're correct. CustomerAddress object is a custom object and Purpose is a menu ID field in that object. The custom object and the menu both reside in CO package.

      For better understanding of the object structure, I'm uploading the document containing the screenshot of CustomerAddress object structure.

      Please guide me. Appreciate your help.

      Thanks,

      Farhad.

       

    • Pramod Vasudeva Murthy

      Apologies for late response, PFA code.

       

    • Farhad Pagdiwala

      Hello Pramod:

                  No Problem. Thank you so much for the sample code. So, basically for update operation as well it will be the similar SOAP XML structure, but with Update call in                           <soap:Body> tag or is it that we cannot perform Update on NAMED_ID columns?

      Thanks,            

      Farhad.

    • Pramod Vasudeva Murthy

      Yes. PFA sample code.

      ~VIP

    • Farhad Pagdiwala

      Thank you Pramod for the sample code. It seems that the NAMED_ID fields can be updated individually and not with the fields of other datatypes such as String or Integer. When trying to update it with other fields, it tends to insert the NAMED_ID fields in between the GenericFields tag for String and Integer fields as you will see in the attached file.

      I wonder why?

      Between, I tried updating NAMED_ID fields separately and it works fine.

    • Pramod Vasudeva Murthy

      If you are using an Update which has object ID as mandatory and trying to update a data menu then you could either try with Name or ID; no need to provide both. With regards to fields appending it depends on how to build XML structure.

      Could it be possible if you are adding more fields which needn't be there?

      ~VIP

    • Farhad Pagdiwala

      Sorry I couldn't get back to you earlier. No, I am not appending anymore fields, which aren't needed. Eventually, I ended up updating NAMED_ID elements in a separate update call as I was not able to update in a single update call.

      However, I am am facing another problem while creating a customer address in the custom object CustomerAddress.

      Here, the column OrgId is a foreign key to the Orgs (Custom object). Hence, it's a NAMED_ID field, for which the value needs to be inserted while creating a customer address.

      I am again facing the below error message:

      SOAP fault from Item: RightNowSyncService|urn:wsdl.ws.rightnow.com/v1_3 failed

      Found out-of-order or unrecognized node while parsing node of type DataValue|urn:generic.ws.rightnow.com/v1_3

      Why is it throwing "Out-of-order unrecognized node of type DataValue"?

      I am seeing that the middleware is inserting a NamedIDValue tags for every other field, while passing file to OSvc Create call. Attached is the file been passed to the OSvc Create call.

      I don't know why it is passing NamedIDValue tags for each and every field. 

      Are the fields with NAMED_ID datatype have to be the first element to be passed in the XML SOAP envelope?

      Please help and guide me.