Zoho CRM java SDK throws exception while create records
Hi there,
I am getting the exception from Zoho CRM java sdk while creating records.
Below is the code.
and the exception.
Excption image
try {
ZCRMRestClient.initialize(); // Initialize app with credentials
} catch (Exception e) {
e.printStackTrace();
}
// Select Module type
List<ZCRMRecord> records = new ArrayList<>();
ZCRMRecord record1 = new ZCRMRecord("Products"); //module api name
ZCRMUser owner = ZCRMUser.getInstance(675035425l);// user id
record1.setOwner(owner);
record1.setFieldValue("Product_Name", "mass_create1");// field api name with its value
ZCRMRecord record2 = new ZCRMRecord("Products"); //module api name
ZCRMUser owner2 = ZCRMUser.getInstance(675035425l);// user id
record2.setOwner(owner2);
record2.setFieldValue("Product_Name", "mass_create2");// field api name with its value
records.add(record1);
records.add(record2);
ZCRMModule module = ZCRMModule.getInstance("Products"); //module api name
BulkAPIResponse response = null;
try {
response = module.createRecords(records);
} catch (ZCRMException e) {
e.printStackTrace();
}
List<ZCRMRecord> insertedRecords = (List<ZCRMRecord>) response.getData();
List<BulkAPIResponse.EntityResponse> entityResponses =
response.getEntityResponses();// to check the status of the request
String rec1Status = entityResponses.get(0).getStatus();//check status of record1
String rec2Status = entityResponses.get(1).getStatus();//check status of record2