You need to sign in to do that
Don't have an account?

Javascropt Error
Hi All,
I am getting following error in javascript. Please help me with this error.
Error: The Name field is required.
Thanks in Advance
I am getting following error in javascript. Please help me with this error.
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} var newRecords = []; var coapp = new sforce.SObject("Lead"); coapp.id ="{!Lead.Id}"; coapp.Name="{!Lead.Name}" coapp.Rating="Hot"; newRecords.push(coapp); result = sforce.connection.update(newRecords); window.location.reload();
Error: The Name field is required.
Thanks in Advance
I think you just need to add and semicolon after "{!Lead.Name}";
Regards,
Soyab
All Answers
I think you just need to add and semicolon after "{!Lead.Name}";
Regards,
Soyab
I went through your problem. you can't use all mandatory fields of Lead.
You can use the below code:-
{!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")}
var newRecords = [];
var coapp = new sforce.SObject("Lead");
coapp.id ="{!Lead.Id}";
coapp.LastName="{!Lead.LastName}";
coapp.Company="{!Lead.Company}";
coapp.status="{!Lead.status}";
coapp.Rating="Hot";
newRecords.push(coapp);
result = sforce.connection.update(newRecords);
window.location.reload();
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,
Deepali Kulshrestha
www.kdeepali.com