• Ravi Jampana 14
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Here is the code i am using.

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}


var c = new sforce.SObject("Lead");
c.id = "{!Lead.Id}";
c.Contact_Attempt__c = 'True';

var discription = prompt("Call Discription", "");
var notes = "{!Lead.Discussion_Notes__c}";
var note = notes +  "\r" + "{!User.Alias}" + "--" + discription + "--" + "{!NOW()}" ;
c.Discussion_Notes__c = note;
result = sforce.connection.update([c]);

window.location.reload();

Discussion_notes__c is the long text area i am using.. Its working for 1st two times. After it creates two lines it gives me a error saying "A problem with the OnClick JavaScript for this button or link was encountered:unterminated string literal"