How to Set Automatic Expiry for Web Forms in ERPNext?

Hello Frappe Community,

I’m looking for guidance on implementing automatic expiry for web forms in ERPNext. Specifically, I want to set a preset expiration date for a web form, and after that date, the form should automatically be disabled, preventing users from submitting it.

How can I achieve this functionality without manual intervention? Is there a way to configure ERPNext to close a web form after a specific time and date?

I appreciate any insights, suggestions, or examples on how to implement this feature effectively.

Thank you!

You can add a custom field for unpublish time and schedule background job for which executes and unpublishes the particular webform by checking for the time set in the custom field.

should I create custom app first inorder to do this?

You can write a server script without using a custom app https://docs.erpnext.com/docs/user/manual/en/server-script. You can use script type as scheduler event and set event frequency.