I’m working on an external script that uses REST Api to import and change records (Leads for now), and I might need to rename some records. So I’ve configured the Lead doctype to allow renaming, and I can successfully rename records with the form on the Lead record itself, or by using the bulk rename tool.
But when I try to use the Rest Api, the ‘name’ field sent in the body is used to find the record, and not to update the field itself, so I have an error. This works if I change other fields. I really want to change the ‘name’ field, not just the ‘lead_name’, as the script needs to update things after changing naming serie.
I’m using a PUT request to /api/resource/Lead/<name of the lead, CRM-LEAD-YYY-XXXXX>, with the updated ‘name’ field in the request body, such as ‘CRM-NEWNAME-YYYY-XXXXX’.
The error is that the record is not found, I think because the API use the new name field in the body to search for the record to modify.
Is there any way to update record’s names through the rest api ?
Thanks for your help. And thanks to the whole Frappe/ERPNext team for such nice softwares