Quotation customization (Organization name )

                                    Lead     -------------------------------------       Quotation 

                                    customer                                                  customer
                                    organization                                            organization 

when we make a quotation from a lead

it catch only the customer name

i need to make a new field called Organization name

and make it fetch his data from that lead organization

so when i print the quotation i got

organization name
customer name

Thanks a lot dear for your guides

Add a custom field in Quotation doctype, name it same as in Lead doctype from Customize Form. It will fetch the value automatically.

1 Like

Thank u dear for help

actually i added a costume field in quotation

Organization Name
type Data

but it did not fetch any thing
as u see it fetch the customer name only , not the organization name ,

Waiting your views dears

you need a custom script for that.

1 Like

Offcourse dear thats is what i am asking for

i need to fetch the organization name from that leads organization and put it in the quotation

so when i see the quotation i see both fields
1- customer name
2-organization name
that are linked to that lead

frappe.ui.form.on(“DOCTYPE”, “field_that_is_triggered_on_change”, function(frm) {
var x = frappe.model.get_doc(“ANOTHER_DOCTYPE”,frm.doc.key);
cur_frm.set_value(“target_field”,x);
});

2 Likes

great dear can u please help me to type it

is it true like this

frappe.ui.form.on(“Quotation”, “lead”, function(frm) {
var x = frappe.model.get_doc(“Lead”,frm.doc.key);
cur_frm.set_value(“organization_name”,x);
});

var x = frappe.model.get_doc(“Lead”,frm.doc.primary_key_of_lead); //key = name
cur_frm.set_value(“organization_name”,x.some_field_name);

1 Like

i made a custome script related to quotation doctype

and i past this in it

frappe.ui.form.on(“Quotation”, “lead”, function(frm) {
var x = frappe.model.get_doc(“Lead”,frm.doc.primary_key_of_lead); //key = name
cur_frm.set_value(“organization_name”,x.some_field_name);

Now the quotations is not open

in your browser, right click and then “inspect” to see the problem (works in chrome, I forgot how to do it in other browsers you can google it)

1 Like

Thank u dear for your help

actually i am working on chrome.

But i successfully achieve my Goal using another Technics

i created a costume field in Quotation Doctype

Organization name
type data
Options lead.company_name
depend on lead
Read Only

And It works very well

1 Like