I have a custom settings which has the following columns:

Department || Sub Department || Employee || Serial Number

My code is :

for(CustomSettings__c cst: CustomSettings__c.getAll().values()) {

So the list should get fetched arranged in ascending order according to serial number.

Currently there are 10 records and I need to add 4 more . If I'm adding any extra , it's not coming up in my final output. Total records getting fetched is still 10 . But if I change the serial number of a new record to say 5 , that is getting fetched and the old record , whose serial number is now beyond 10 , is not getting fetched.

In Developer console , all custom settings are getting fetched.

Please suggest.

  • What is your custom setting name? Is it Employee__c ? Also Employee__c is one of the 4 fields in the custom setting Employee__c? If so what's your requirement ? Do you want to apply a custom sort order on your custom setting based on the field 'Serial_Number__c'? What is the data type for the field 'Serial Number' ? – Jarvis Mar 20 '15 at 5:23
  • Typically you are saying that you are not able to retrieve more than 10 records even though if you have more than 10 .. am I right? – Kiran Mutturu Mar 20 '15 at 5:25
  • @Bennie Apologies , my custom setting name is something different . I have my custom settings defined . And I have some operations going on with records from other objects in a wrapper class . So for the Department || Sub Department || Employee combination in those records , I am fetching the Serial Number from custom settings of that combination and assigning it to a variable in wrapper class . And in the final display , records are displayed in order of serial number in Custom Settings. – Vanilla_Sky Mar 20 '15 at 7:04
  • @KiranMutturu Yes correct . That's the issue. – Vanilla_Sky Mar 20 '15 at 7:05
  • Are you adding the new records to the custom setting object using Apex? – Kiran Mutturu Mar 20 '15 at 7:09

Please check whether the field type of Serial_Number__c field is it Number with length of 1 digit by any chance?

This looks like a strange issue. Also try once by directly using SOQL also. Like below,

List<Custom_Setting__c> customList = [select field1__c, field2__c from Custom_Setting__c];

If still not working, I think you might have to raise a ticket with salesforce support team.

| improve this answer | |
  • It's already fetching 10 records , so will length be an issue still? – Vanilla_Sky Mar 23 '15 at 9:37

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.