Untitled
unknown
plain_text
4 years ago
713 B
9
Indexable
public class helper_class {
public static void metodo_trigger(list <contact> contatti) {
list <contact> copia = [select id, accountid, description from contact where id in: contatti];
list <contact> app = new list <contact> ();
account a = new account (name = 'nome');
insert a;
for (contact c : copia) {
if(c.accountid == null) {
c.accountid = a.id;
app.add(c);
}
else {
if (c.description != 'possiede già un padre'){
c.description = 'possiede già un padre';
app.add(c);
}
}
}
update app;
}
}Editor is loading...