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

Custom field type number
Hello,
I created a custom field of satisfaction with type number.
I made a reques to see what returned me:
select Name,Satisfaction__c from Contact
And I is not got what I wanted:
The desired:
Name, Satisfaction__c
Marcia Morgado, 10
Rosana Moreira, 8
Vanessa Pedrozo, 7
The obtained:
Name, Satisfaction__c
Marcia Morgado, 0032000001E3fVyAAJ
Rosana Moreira, 0032000001D8WWsAAN
Vanessa Pedrozo, 0032000001D8Y4nAAF
CODE:
How do I solve this problem with numeric fields?
Thank you,
I created a custom field of satisfaction with type number.
I made a reques to see what returned me:
select Name,Satisfaction__c from Contact
And I is not got what I wanted:
The desired:
Name, Satisfaction__c
Marcia Morgado, 10
Rosana Moreira, 8
Vanessa Pedrozo, 7
The obtained:
Name, Satisfaction__c
Marcia Morgado, 0032000001E3fVyAAJ
Rosana Moreira, 0032000001D8WWsAAN
Vanessa Pedrozo, 0032000001D8Y4nAAF
CODE:
String query=inputText; String first=query.substringAfter('select '); first= first.substringBefore('from'); string title= first+'\n'; string contenuCSV = title; string queryResultString = ''; list<sObject> queryResult = (List<sObject>)database.query(inputText); for(sObject a: queryResult) { queryResultString = queryResultString + string.valueof(a); } list<string> queryLines = queryResultString.split('}'); for(string s:queryLines){ list<string> queryCol = s.split(','); for(string st:queryCol){ contenuCSV = contenuCSV + st.substringAfter('=') + ','; } contenuCSV = contenuCSV.substringBeforeLast(',').substringBeforeLast(',') + '\n'; }
How do I solve this problem with numeric fields?
Thank you,
the values you have are all Contact record Ids (starting with 003 .. )
Marcia Morgado, 0032000001E3fVyAAJ
Rosana Moreira, 0032000001D8WWsAAN
Vanessa Pedrozo, 0032000001D8Y4nAAF
where do you get the inputText from ? once you change the actual query in the inputText it should work fine..
Either your inputText is not correct, or your field Satisfaction__c is not a number but an Id (or a formula leading to an Id).
You should add a system.debug(inputText) or add it to contenuCSV to check what happens.