function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ViloVilo 

Error executing getUpdated for SelfServiceUser object

Hi,

After downloading Java Samples [sforce 6.0] from https://www.sforce.com/us/downloads/EnterpriseSamples6_0.zip and I have been testing Samples.java

I run into a problem with running getUpdatedSample() for SelfServiceObject. The code fails on GetUpdatedResult mr = binding.getUpdated("SelfServiceUser", (Calendar)cal, (Calendar)calEnd);

I went further with debugging, and the call seems to fail in SoapBidingStub.java on line:
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {sObjectType, startDate, endDate});

All other objects work fine. Any idea what is going on?

Thank you,
Peter

Here is the source code:

private void getUpdatedSample() {
  //Verify that we are already authenticated, if not
  //call the login function to do so
  if (!loggedIn) {
    if (!login()) {
   return;
    }
  }

  try {
   //Calendar deletedDate
   GregorianCalendar cal = (GregorianCalendar) binding.getServerTimestamp().getTimestamp();
   GregorianCalendar calEnd = (GregorianCalendar)cal.clone();
   cal.add(GregorianCalendar.MINUTE, -5);   
   
   GetUpdatedResult mr = binding.getUpdated("SelfServiceUser", (Calendar)cal, (Calendar)calEnd);
   if (mr.getIds() != null && mr.getIds().length != 0) {
    for (int i=0;i<mr.getIds().length;i++) {
     System.out.println(mr.getIds(i).getValue() + " was updated.");
    } 
   } else {
    System.out.println("No updates to accounts in the last 5 minutes.");
   }
   //getUserInput("\nHit return to continue...");
  }
  catch (UnexpectedErrorFault uef) {
    System.out.println("ERROR\nERROR\nERROR\n" + uef.getExceptionMessage());
    getUserInput("\nHit return to continue...");
    loggedIn = false;
  }
  catch (Exception ex) {
    System.out.println(
     "\nFailed to execute query succesfully, error message was: \n"
     + ex.getMessage());
    getUserInput("\nHit return to continue...");
    loggedIn = false;
  }
  try {
   Thread.sleep(300);
  } catch (InterruptedException e) {
   
   e.printStackTrace();
  }
 }

SuperfellSuperfell
how is it failing, what error do you get ?
ViloVilo

The error message doesn't say much.

ex.getMessage() in a catch block returns: null

Peter

ViloVilo

Does it have something to do with "Object can be used in replication = false" in describe call for SelfServiceUser? Here is a list of all describe object atributes:

Object name = SelfServiceUser
Number of fields = 17
Object can be activated = false
Can create rows of data = true
Object is custom object = false
Can delete rows of data = false
Can query for rows of data = true
Object can be used in replication = false
Can use retrieve method on object = true
Can use search method on object = false
Can un-delete rows of data = false
Can update rows of data = true

Peter