I have added some custom fields, such as Phone Number, Documents (Child Table), Address, etc to the Job Applicant Doctype. I want to capture these details from applicants through a Web Form since they do not have access to the Desk. Additionally, I want to update these details in the existing Job Applicant Doctype.
I don’t wanna get custom fields in Current webform I want to update existing record
My Case
HR Manager will create a Job Applicant record (e.g. HR-JP-******)
If an applicant is shortlisted then in same record(HR-JP-***) I want to collect applicant details(Phone Number, Documents (Child Table), Address, etc) for which I have created a new web form with fields Phone Number, Documents (Child Table), Address, etc
for now I have applied my custom logic in validate function and it is working as expected, but while going through web_form.py code I’ve found something related to update existing record.
I’m suggesting you try with a normal server script. When the web form is saved, it will basically save the data to a doctype. So, when the doctype is saved, you can update the data using doc_events. Give it a try. (Not tested, but maybe it should work.)
If I will do in after save event then it will create a new record in doctype and I don’t want to create a new record I want to update the data in the existing record .
I think you didn’t understand my case. I have already tried using the “after save” event; it is creating a new record through the webform. I don’t want to create a new record; I want to update an existing record, which the HR Manager created.
Hi @ducminhgd
I have made a server call in the validate method in js and saved the form data manually by passing the unique name in the form. I took code from this function, modified it a little, and after saving the data, returned false in the validate function.