You need to sign in to do that
Don't have an account?
hokie_high
Need help on "Case" Object
Hello, this might sounds very simple to you but I'm new to java, it seems I can't get the "Case" query working. I got the Enterprise sample running and it has samples for "Account", "Contact and "Task" so I know how to work with those objects. But work with "Case" seems different. I can't declear something like: Case myCase = (Case) qr.getRecords()[i]; since java can't resolve Case class.
Could someone post some sample code for "Case" object to get me started? I want to be able to run Case Update/Insert. Thanks a lot!
-Alex
I have done many queries of cases.
Are you using the _case object? In java, when you gen the proxy classes ( assuming you are using axis ), the data type for Case is _case to get around the java keyword.
Given an array of cases coming back from the query method called 'cases'
for ( int i = 0; i < cases.length; i++ ) {
_case myCase = (_case ) cases[i];
System.out.println( myCase.getId().getValue();
...
}
Scott, thanks for the tip and sample.
It seems I'm having trouble to run this query:
...
myCases = ( (_case) qr.getRecords()[i]);
System.out.println( myCases.getId().getValue());
...
it returns:
Failed to execute query succesfully, error message was:
null
Could someone please point out where I did wrong? Thanks.
Are you getting records back ( i.e. your qr.getRecords() is not null?) Are there errors on the QueryResult obj? This should be very straight-forward, just like your other queries you said were working...
You have to select the ID field in your query to print it out here. That might also be the problem.
Might help if you post up your query and some more of the code...
Scott, THANK YOU!
It was the ID field, I didn't know I need to query that field.