Try ERPNext Buy Support Partners Foundation

How to redirect to Form from Portal

How to redirect to Form from Portal

Create a Webform with the document you want, then redirect to it with an <a href=".......">.
For more info: https://frappe.io/docs/user/en/guides/portal-development/web-forms

Thank you
href is working for web pages
can we redirect to new form with values

for example i need to move to Task Desk New From With Default Project Value ?

can we give argument in href val

Yes,
to create a new webform you need to go with this url:
http://your_server/your-web-form-route?new=1
and if you want to pre-fill some value, go with this one (here setting the currency to CAD):
http://your_server/your-web-form-route?new=1&currency=CAD

Thank you
It is working

Then how to get the value (currency=CAD) from the url?

The flow:

  • webpage button (with link to http://your_server/your-web-form-route?new=1&currency=CAD)
  • click button go to the webform
  • in webform there is a field for currency
  • get the value from url and fill it in the currency field.

I use get_url() but getting the whole url.
Please help. Thank you

If I recall, in your python get_context() method you should add:

currency = frappe.local.form_dict.currency
context['currency'] = currency

then you can use it in your html as {{ currency }}

Thanks. I will try that.