function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SandeepbvSandeepbv 

Unable to insert date to Name field of prospect object

Hi Team! Need Help.

 We are trying to integrate our javascript application with salesforce. During this we need to insert date into Name field of prospect object. We have modifily all permissions on the object, but still we are thrown with a security error.

This is the code we are using to integrate.

data_obj = client.sobjects.Lead.insert(
{

'Name':member_name,
'LastName':member_name,
'Email': email,
'Phone': phone
})
print(data_obj)
User-added image
Please find the attachemnt for error info.

Best Answer chosen by Sandeepbv
AnkaiahAnkaiah (Salesforce Developers) 
Hi Sandeep,

In the lead object Name field is not writable. You can remove the Name field from your code. If you want you can pass the FirstName field instead of Name.

Name field is a concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.

Refer the below help article and check the properties of name field.
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm

If this helps, Please mark it as best answer.

Thanks!!