Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. {!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}
  2. var records ={!GETRECORDIDS($ObjectType.Contact)};
  3. var newRecords = [];
  4. var today = new Date();
  5.  
  6. if (records[0] == null) {
  7. alert("Sélectionnez au moins un Contact")
  8. }
  9. else {
  10.  
  11. for (var n=0; n<records.length; n++) {
  12. var c = new sforce.SObject("Contact");
  13. c.id = records[n];
  14. c.E_mail_proposition_intervention__c = true;
  15. c.Date_envoi_e_mail_proposition_interventi__c = today;
  16. newRecords.push(c);
  17. }
  18.  
  19. result = sforce.connection.update(newRecords);
  20. window.location.reload();
  21. alert("E-mails envoyés");
  22. }`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement