function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SurjenduSurjendu 

for loop not working properly

public DomainCreationData[] getHardCodedData()
{
DomainCreationData[] datas = new DomainCreationData[]{};
DomainCreationData data = new DomainCreationData();
TestExtranet__c[] extranets = [Select Name__c,Extranet_Name__c,URL__c from TestExtranet__c];
for(TestExtranet__c test : extranets)
{
data.setNonUniqueName(test.Name__c);
data.setDomainName(test.Extranet_Name__c);
data.setUrl(test.URL__c);
datas.add(data);
}
return datas;
}

This for loop does not give me the data. If there are four records saved in the database it always give me the 4th record 4 times. That means I am always retreiving the nth record n number of times. Please help.
SurjenduSurjendu
solved it...stupid me...