You need to sign in to do that
Don't have an account?

getting a problem during creating an account through my java code with SOAP Api
Account ac = new Account();
//SObject rec = new Account();
System.out.println("Enter your name \n");
ac.setName(br.readLine());
System.out.println("Enter your Mobile No. \n");
ac.setPhone(br.readLine());
//rec = ac;
SaveResult save = connection.create(ac);
System.out.println(ac.getParentId());
I am getting an error at the bolded line. actually I want to create the accoutn my user but that create statement needs the array of SObject[].......................
so waht shold i do..................
can anyone help me................
thanks................
Try as Following
Account createAccounts []= new Account[1];
Account ac = new Account();
System.out.println("Enter your name \n");
ac.setName(br.readLine());
System.out.println("Enter your Mobile No. \n");
ac.setPhone(br.readLine());
createAccounts[0]= ac;
SaveResult[] saveR = connection.create(createAccounts);
if(saveR[0].isSuccess())
Id = saveR[0].getId();
All Answers
Try as Following
Account createAccounts []= new Account[1];
Account ac = new Account();
System.out.println("Enter your name \n");
ac.setName(br.readLine());
System.out.println("Enter your Mobile No. \n");
ac.setPhone(br.readLine());
createAccounts[0]= ac;
SaveResult[] saveR = connection.create(createAccounts);
if(saveR[0].isSuccess())
Id = saveR[0].getId();
Thanks.......................
I have done that and its usefull and got my result......................