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

split custom setting values
I have a custom setting called BindValues__c which has a single field say value__c
It contains values as : A1 1 , A2 2 , A3 3 , A4 4 , A5 5 , A6 6 , A7 7 , A8 8 , A9 9 , A10 10 , A11 11
I have worked on a code which binds the values into a picklist as shown below , also I attached a screen shot to show my requirement.


so I need to split the custom setting values into 2 parts i. 1 to 5 and 6 to 11.
I hope I am clear.
Please let me know how I can proceed further.
Thanks
sheila
It contains values as : A1 1 , A2 2 , A3 3 , A4 4 , A5 5 , A6 6 , A7 7 , A8 8 , A9 9 , A10 10 , A11 11
I have worked on a code which binds the values into a picklist as shown below , also I attached a screen shot to show my requirement.
public class CodeGeneratorController { public List<SelectOption> Values { get; set; } public CodeGeneratorController() { getValues(); } public void getValues() { Values = new List<SelectOption>(); List<BindVaues__c> allValues = new List<BindVaues__c>(); allValues=[SELECT Name FROM BindVaues__c]; for( BindVaues__c val : allValues) { Values.add( new SelectOption( val.Id, val.Name) ); } } } <apex:page controller="CodeGeneratorController"> <apex:form > <apex:pageBlock > <apex:pageBlockSection > <apex:outputLabel value="Values :"/> <apex:selectList size="1"> <apex:selectOptions value="{!Values}"/> </apex:selectList> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>My requirement is I need to access values from 1 to 5 , then do some processing , then values from 6 to 11 then do some other logic.
so I need to split the custom setting values into 2 parts i. 1 to 5 and 6 to 11.
I hope I am clear.
Please let me know how I can proceed further.
Thanks
sheila
All Answers
Please check once below sample code :
Using offset we can split first 5 records...
Hope this helps you!
If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others.
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com
That meets my requirement.
sheila