You need to sign in to do that
Don't have an account?
SUJAY GANGULY 5
How Can i get a single value from List<String>?
I want to get a value from List<String>. Mean I am storing 3 records at List<String> after that I want to make a checking using that records at Rest Api Update Time. Please check the code:
List<String> RecordValueStore= new List<String>();
List<Account> Acc= new List<Account>();
Acc=[Select id, Name, Company__c from Account];
For(Account a:Acc){
if(RecordValueStore.get(0).id==Acc.get(0).id){
System.Debug('HI');
}
If Else(RecordValueStore.get(0).Name==Acc.get(0).Name){
System.Debug('Hello');
}
If Else(RecordValueStore.get(0).Comapny__c==Acc.get(0).Comapny__c){
System.Debug('OHH');
}
Update a;
}
Update Acc;
All are working cool, but the problem is happening at normal lits string means from the "RecordValueStore" I can't take the values at checking. It shows that "Variable does not exist: Comapny__c"
List<String> RecordValueStore= new List<String>();
List<Account> Acc= new List<Account>();
Acc=[Select id, Name, Company__c from Account];
For(Account a:Acc){
if(RecordValueStore.get(0).id==Acc.get(0).id){
System.Debug('HI');
}
If Else(RecordValueStore.get(0).Name==Acc.get(0).Name){
System.Debug('Hello');
}
If Else(RecordValueStore.get(0).Comapny__c==Acc.get(0).Comapny__c){
System.Debug('OHH');
}
Update a;
}
Update Acc;
All are working cool, but the problem is happening at normal lits string means from the "RecordValueStore" I can't take the values at checking. It shows that "Variable does not exist: Comapny__c"
Change your code like below
Ensure sharing rules from the calling class are enforced for the the 'UtilityClass' Apex class. can you help?