Hi there,
how would I trigger a Webhook using a Button in a DocType?
Thank you for the help!! Love the project!
Cheers
Jan
Hi there,
how would I trigger a Webhook using a Button in a DocType?
Thank you for the help!! Love the project!
Cheers
Jan
Hello @JanMrlth,
If you want to trigger a Webhook using a button in ERPNext, a webhook may be not the right thing to do, see the doc.
Maybe you could create a webhook to ERPNext itself? By using the Rest API.
What do you want to achieve?
Ok, let me explain what I want to do
I am mechanical engineer and build machines. Attached to every part (item), there is a lot of technical documentation. I created a Doctype Download-Links and appended the item view with it. That way I can attach Links to manuals etc to the items.
I order to get a RFQ I need to send technical drawings to the manufacturer. Instead of attaching them to ERP-next and the email, I use n8n to create a shared folder in OneDrive and attach this Link to my Download-Links List.
Not every Part needs a folder. So I want a button in the ITEM, that is only there as long as no folder has been created. Clicking on the button would send the http-post to n8n. n8n the creates the folder, shares it, creates a short-link to the share-link, writes back this Link into the Parts description.
At the moment I have a webhook triggered âafter_insertâ, that sends the needed info to n8n.
I could add a Checkbox âShould Shared Folder be Createdâ and add a Condition to the webhook. But maybe after two weeks I need that folder. The webhook does everything I need. I then want to trigger it once with âthe press of a buttonâ.
I hope that explanation is of any useâŚ
Thank you!
You could add a checkbox âCreate Folderâ to Item, use âon_updateâ as a the Webhook âDoc Eventâ and use a condition like this:
doc.create_folder and not 'https://onedrive' in doc.description
This way you just have to check the checkbox and save the Item to trigger the Webhook.