You need to sign in to do that
Don't have an account?
hemm
Compile Error: For input string: "16000000000"
I am able to add 16000000000 as a value into the Annual Revenue field on account, but if I try and look for accounts with a value greater than that in Apex or the API, I get a
Compile Error: For input string: "16000000000"
account a = [select id, annualrevenue from account where annualrevenue > 16000000000 limit 1][0];
Ideas?
I am really passing along a question from a client. No, the number is not really a practical one, but since the standard field on Accounts called Annual Revenue lets you enter 16000000000, you should be able to query for it.
Maybe an extreme example, but one that demonstrates where the UI functionality and the API/Apex may not align.
The AnnualRevenue field I am referring to is the one that comes standard from Salesforce on Accounts.
This works
account a = [select id, annualrevenue from account where annualrevenue > 1600000000 limit 1][0];
This doesn't
account a = [select id, annualrevenue from account where annualrevenue > 16000000000 limit 1][0];
Both values can be entered on an Account in the UI.
Anyone know the issue?
That number is 16 billion, not trillion. I have a customer that tracks governmental budgets and they need to query up ones with revenues greater than a certain value. 16 billion for many governments is normal. Either way, they use these numbers and Apex (and the API) give this error.
I found the answer on another post (http://community.salesforce.com/t5/NET-Development/Malformed-query-exception-please-help/m-p/97671#M6761)
It has something to do with data types with Salesforce. If you add a decimal point and make it 16000000000.0, it works.
Many years later, salesforce has the same error and I have to say, THANK YOU!
I had the same with a query in flow, and adding a decimal point to the number works.