Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

I get an error when I try to set a checkbox with the Salesforce Partner API.

I have tried different combinations, but I get the error that an Object is required.

Confirmed__c is a checkbox and this is what I have tried

com.sforce.soap.partner.sobject.SObject record = new com.sforce.soap.partner.sobject.SObject();
record.setField("Confirmed__c",true);
record.setField("Confirmed__c",1);
record.setField("Confirmed__c","true");
record.setField("Confirmed__c","1");

This is the error I get when I compile

Incompatible type for method. Can't convert boolean to java.lang.Object.
record.setField("Confirmed__c",true);

I would appreciate it very much if someone could help me out with the correct way to accomplish this. I tried to find some examples on the web and I found one post, where it appears the first option above have worked, so not sure why I am getting this error?

http://stackoverflow.com/questions/12508026/how-to-disable-deactivate-a-salesforce-user-through-soap-apihttps://stackoverflow.com/questions/12508026/how-to-disable-deactivate-a-salesforce-user-through-soap-api

Many Thanks, Kent

I get an error when I try to set a checkbox with the Salesforce Partner API.

I have tried different combinations, but I get the error that an Object is required.

Confirmed__c is a checkbox and this is what I have tried

com.sforce.soap.partner.sobject.SObject record = new com.sforce.soap.partner.sobject.SObject();
record.setField("Confirmed__c",true);
record.setField("Confirmed__c",1);
record.setField("Confirmed__c","true");
record.setField("Confirmed__c","1");

This is the error I get when I compile

Incompatible type for method. Can't convert boolean to java.lang.Object.
record.setField("Confirmed__c",true);

I would appreciate it very much if someone could help me out with the correct way to accomplish this. I tried to find some examples on the web and I found one post, where it appears the first option above have worked, so not sure why I am getting this error?

http://stackoverflow.com/questions/12508026/how-to-disable-deactivate-a-salesforce-user-through-soap-api

Many Thanks, Kent

I get an error when I try to set a checkbox with the Salesforce Partner API.

I have tried different combinations, but I get the error that an Object is required.

Confirmed__c is a checkbox and this is what I have tried

com.sforce.soap.partner.sobject.SObject record = new com.sforce.soap.partner.sobject.SObject();
record.setField("Confirmed__c",true);
record.setField("Confirmed__c",1);
record.setField("Confirmed__c","true");
record.setField("Confirmed__c","1");

This is the error I get when I compile

Incompatible type for method. Can't convert boolean to java.lang.Object.
record.setField("Confirmed__c",true);

I would appreciate it very much if someone could help me out with the correct way to accomplish this. I tried to find some examples on the web and I found one post, where it appears the first option above have worked, so not sure why I am getting this error?

https://stackoverflow.com/questions/12508026/how-to-disable-deactivate-a-salesforce-user-through-soap-api

Many Thanks, Kent

Source Link
Kent
  • 157
  • 2
  • 5

Cannot set value on checkbox using sObject via Partner API using Java

I get an error when I try to set a checkbox with the Salesforce Partner API.

I have tried different combinations, but I get the error that an Object is required.

Confirmed__c is a checkbox and this is what I have tried

com.sforce.soap.partner.sobject.SObject record = new com.sforce.soap.partner.sobject.SObject();
record.setField("Confirmed__c",true);
record.setField("Confirmed__c",1);
record.setField("Confirmed__c","true");
record.setField("Confirmed__c","1");

This is the error I get when I compile

Incompatible type for method. Can't convert boolean to java.lang.Object.
record.setField("Confirmed__c",true);

I would appreciate it very much if someone could help me out with the correct way to accomplish this. I tried to find some examples on the web and I found one post, where it appears the first option above have worked, so not sure why I am getting this error?

http://stackoverflow.com/questions/12508026/how-to-disable-deactivate-a-salesforce-user-through-soap-api

Many Thanks, Kent