Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3371 Tampilan

Hi all,

looking for solution how I can pass default values to a form field from specific URL. I have situation where visitor can click a product link that redirects to contact form. I would like to pass value via link to a field on that form, so he/she don't have to enter this choice again. 


I was trying something like this:

http://example.com/contactus?=


but that does not work. Any ideas how to solve that?

Avatar
Buang
Jawaban Terbai

You can use one of:

- name
- phone
- email_from
- company
- subject

that will prefill your form


E.g.: https://17449094-15-0-all.runbot43.odoo.com/contactus?subject=foo&phone=bar

Avatar
Buang

This will work for the default Contact form, but for some reason it doesn't work for any custom forms built with the form builder snippet. Any ideas why not?

Jawaban Terbai

To Andrew Hastings : because it's coded that way in the core ... (and if you want something else, this is a change request)

It's (almost) the answer I received from Odoo

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Agu 22
3885
1
Apr 22
2986
1
Mar 22
2215
1
Feb 22
2219
0
Feb 22
1965