• Mamatha
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies


I am trying to update Account ID of a Contact. But I am getting error that IS is not specified. Can any one help me with this.

Here is the code fragment:

queryResult_Task = bindingStub.query("select Customer_Type__c, Email,FirstName, MailingCity, MailingPostalCode, MailingState, MailingStreet, Phone, LastName, AccountId from Contact where CreatedDate >"+ date3 +" and LastModifiedDate <"+ date11+ " and AccountId = ''");

if(queryResult_Task.getRecords()!=null)
   {
    for(m=0;m<queryResult_Task.getRecords().length;m++)
     {

     
     Contact contact= (Contact)queryResult_Task.getRecords(m);
     ID Accountid= contact.getAccountId();
     ID recordtype=contact.getRecordTypeId();
     
     if(contact.getAccountId()==null)
      { 

      ID id_account = new ID();
      id_account.setValue("00130000004MQtB");
      contact.setAccountId(id_account);     
      
      SObject[] sObjects12 = new SObject[1];
      // Add the accounts to the SObject array
      sObjects12[0] = contact;          
      // Invoke the create call
      SaveResult[] saveResults12 = bindingStub.update(sObjects12);
      System.out.println("before for loop save result length " + saveResults12.length);   
  
       // Handle the results
       for (int m=0;m<saveResults12.length;m++)
      {
      System.out.println("inside for " + saveResults12[0].isSuccess());               
       // Determine whether create succeeded or had errors
       if (saveResults12[m].isSuccess())
      {      
        System.out.println("Object created");      
       }
       else
      { Error err1 = saveResults12[m].getErrors()[0];
        System.out.println("Error code: " + err1.getStatusCode() + " Error Message: " + err1.getMessage());
        System.out.println("Object is not created");
       }
      }
      }
     }
   }

 

Here is the error code:

Error code: MISSING_ARGUMENT Error Message: Id not specified

  • September 27, 2005
  • Like
  • 0