• steven.warren
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi, I am able to upsert a contact record referencing the external field of its account relationship. But if I try to do that with a custom table I get the following error:

"Unexpected element {}type during simple type deserialization"

Does anyone have any experience or insight into this issue? Here's the code fragment in question:

Code:
    ArrayList elements = new ArrayList();

    elements.add(new MessageElement(new QName("SPS_Account_ID__c"), id));

    // Foreign key relationship to the Account object
    MessageElement client_me = new MessageElement(new QName("Account__c"));
    client_me.addChild(new MessageElement(new QName("type"), "Account"));
    client_me.addChild(new MessageElement(new QName("Client_ID__c"),  accountID));
    elements.add(client_me);

    SObject[] sObjects = new SObject[1];
    sObjects[0] = new SObject();
    sObjects[0].setType("SPS_Account__c");
    sObjects[0].set_any((MessageElement[]) elements.toArray(new MessageElement[elements.size()]));



Message Edited by steven.warren on 04-08-2008 04:45 PM
Hi, I am able to upsert a contact record referencing the external field of its account relationship. But if I try to do that with a custom table I get the following error:

"Unexpected element {}type during simple type deserialization"

Does anyone have any experience or insight into this issue? Here's the code fragment in question:

Code:
    ArrayList elements = new ArrayList();

    elements.add(new MessageElement(new QName("SPS_Account_ID__c"), id));

    // Foreign key relationship to the Account object
    MessageElement client_me = new MessageElement(new QName("Account__c"));
    client_me.addChild(new MessageElement(new QName("type"), "Account"));
    client_me.addChild(new MessageElement(new QName("Client_ID__c"),  accountID));
    elements.add(client_me);

    SObject[] sObjects = new SObject[1];
    sObjects[0] = new SObject();
    sObjects[0].setType("SPS_Account__c");
    sObjects[0].set_any((MessageElement[]) elements.toArray(new MessageElement[elements.size()]));



Message Edited by steven.warren on 04-08-2008 04:45 PM