0

I have an app that create news account in my SalesForce. All the fields are okay, unless the number fields, "int" and "double", don't throw any kind of error, just doesn't appear in SalesForce.

Some pieces of code and images:

            Account sfdcAccount = new Account();

            sfdcAccount.Name = "Sample from c#"; 
            sfdcAccount.OwnerId = "005240000018waEAAQ";
            sfdcAccount.Type = "Cliente";
            sfdcAccount.Id_SQL__c = 15;
            sfdcAccount.CIF__c = "43210000-X"; 
            sfdcAccount.Phone = "112"; 
            sfdcAccount.AnnualRevenue = 10; 
            sfdcAccount.NumberOfEmployees = 20; 
            sfdcAccount.ActividadEmpresa__c = "Hello"; 

            SaveResult[] saveResults = _enterpriseSoapAPIBinding.create(new sObject[] { sfdcAccount });

Then in salesforce appear like this:

enter image description here

(Is in spanish, sorry for this, but the three fields with numbers are the 3 lasts, "NumberOfEmployees" = "Empleados", "AnnualRevenue" = "Ingresos Anuales", and Id_SQL was the custom field, Id_SQL)

As we can see, the number type fields are empty, any ideas?

  • did you tried with 10.0,20.0 respectively? – Himanshu Oct 15 '15 at 11:18
  • It failed too, btw NumberOfEmployees is a int that doesn't allow decimals. – Salesforce_SF1 Oct 15 '15 at 11:23
1

Any field that is not string will have a boolean property with the same name but with "Specified" appended to the end. For any non-string property you set you also need to set that "Specified" property to true.

Account sfdcAccount = new Account();

sfdcAccount.Name = "Sample from c#"; 
sfdcAccount.OwnerId = "005240000018waEAAQ";
sfdcAccount.Type = "Cliente";
sfdcAccount.Id_SQL__cSpecified = true;
sfdcAccount.Id_SQL__c = 15;
sfdcAccount.CIF__c = "43210000-X"; 
sfdcAccount.Phone = "112"; 
sfdcAccount.AnnualRevenueSpecified = true;
sfdcAccount.AnnualRevenue = 10; 
sfdcAccount.NumberOfEmployeesSpecified = true; 
sfdcAccount.NumberOfEmployees = 20; 
sfdcAccount.ActividadEmpresa__c = "Hello"; 

SaveResult[] saveResults = _enterpriseSoapAPIBinding.create(new sObject[] { sfdcAccount });
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.