0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

何が悪いんだろうか?

Last updated at Posted at 2025-04-19

Superbadgeもうまくいかんし、Apexも何が悪いんだか...

image.png

image.png

分からん

もう今日は止めよう。8時間かかっても、3しかクリアーできなかった

List<Contact> updateContactList = new List<Contact>();
Set<String> ContactSet = new Set<String>();

ContactSet.add('Abigail Mason;abbiemason@example.com');

Set<String> xxxSet = new Set<String>():
Map<String,String> xxxMap = new Map<String,String>();
for (String con : ContactSet){
    List<String> xxx = con.Split(';');
    xxxSet.add(xxx[0]);
    xxxMap.put(xxx[0],xxx[1]);    
}

List<Contact> ContactList = [select Id,Name from contact where Name =: xxxSet];
for (Contact con : ContactList){
    Contact c = new Contact();
    c.Id = con.Id ;
	String e = (String)xxxMap.get(c.Name);
    if (e != null) {
        c.email = e;
    	updateContactList.add(c);    
    }   
    
}

:になっていた!!!!

List<Contact> updateContactList = new List<Contact>();
Set<String> ContactSet = new Set<String>();

ContactSet.add('Abigail Mason;abbiemason@example.com');

Set<String> xxxSet = new Set<String>();
Map<String,String> xxxMap = new Map<String,String>();
for (String con : ContactSet){
    List<String> xxx = con.Split(';');
    xxxSet.add(xxx[0]);
    xxxMap.put(xxx[0],xxx[1]);    
    system.debug('*******xxx***' + xxxMap);
}

List<Contact> ContactList = [select Id,Name from contact where Name =: xxxSet];
system.debug('***********' + ContactList.size());
for (Contact con : ContactList){
    Contact c = new Contact();
    c.Id = con.Id ;
	String e = (String)xxxMap.get(con.Name);
    system.debug('********e***' + e);
    if (e != null) {
        c.email = e;
    	updateContactList.add(c);    
    }   
    
}
system.debug(updateContactList.size());
if (updateContactList.size() > 0) update updateContactList;
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?