You need to sign in to do that
Don't have an account?
Sean_k
Id feild in custom objet
Hi,
I created a custom object called myAccount on sforce,and programatically inserted some data.when i tried to display the data i got A Nullpointer exception at
qr.getRecords(i).getId().getValue();
I did not create any feild with name Id,but my understanding is id is a implicite feild.
I created the Record Name:Account_key with data type Auto Number and display type {0}
is it causing any problem?
Thanks
Sean
I created a custom object called myAccount on sforce,and programatically inserted some data.when i tried to display the data i got A Nullpointer exception at
qr.getRecords(i).getId().getValue();
I did not create any feild with name Id,but my understanding is id is a implicite feild.
I created the Record Name:Account_key with data type Auto Number and display type {0}
is it causing any problem?
Thanks
Sean
yes Id was not there in the select query,i thought as getId() is part of API it will implicitely set that.
If id is treated as a normal feild,why it is not displying when i use the following code.(It displays the other names and values though...)
for (int i=0;i MessageElement[] records = qr.getRecords(i).get_any();
HashMap fields = new HashMap();
// if (qr.getRecords(i).getId() != null) fields.put("id", "'"+qr.getRecords(i).getId().getValue()+"'");
for (int j=0;j MessageElement record = records[j];
if (!fields.containsKey(record.getName().toLowerCase())){
String recname = record.getName().toLowerCase();
String value = record.getValue();
System.out.print("Record name = "+recname);
System.out.println(" Value = "+value);
fields.put(record.getName().toLowerCase(),"'"+record.getValue()+"'");
}
}