Javascript button in CRM (InsideSales) to create time/name stamp notes in description -
image shows existing "add notes button" in sales notes section tried copy , paste javascript recreate credit notes section, keeps popping notes sales section.
what need change in script assign credit notes description box? here java script being used
var nfieldname = "description"; //set field name of notes field. example "description"; or "customfields_67"; if(document.getelementbyid('phone')) //a check see if it's in edit mode {ldelim} o = prompt ("please type in notes", ""); if(o==null||o=="") // check see if notes entered {ldelim} return false; //stops script if no notes entered {rdelim} d = new date(); //grabs date m = d.getmonth()+1; day = d.getdate(); y = d.getfullyear(); h = d.gethours(); if (h >12) //changes 24 hour clock / pm {ldelim} h = h-12; = "pm"; {rdelim} else {ldelim} = "am"; {rdelim} min = d.getminutes(); if (min <10) //adds '0' minutes if under 10. example -- 09 instead of 9. {ldelim} min ="0"+min {rdelim}; sec = d.getutcseconds() if (sec <10) //adds '0' seconds if under 10. example -- 09 instead of 9. {ldelim} sec ="0"+sec {rdelim}; var prevnotes = document.getelementbyid(nfieldname).value; //grabs existing notes. document.getelementbyid(nfieldname).value = "{$session_user_fname} {$session_user_lname} on " +m+ "/" +day+ "/" +y+ " @ " +h+":"+min+":"+sec+" "+am+": "+o+""+"\r\r"+prevnotes; //adds name, timestamp, new notes, old notes. {rdelim} else {ldelim} alert("you must in edit mode use function"); //error given if they're in view mode instead of edit mode. {rdelim}
Comments
Post a Comment