I have requirement in which customer is buying frequent item so by making
quotation for them those main items should be added into that separate table.
so i have created new doctype named “Customer Items” in customer and name of the table is “customer_item” and added some values like equipment , pressure etc . and also created new doctype “quotation specific customer items” and used table named “customer_item” with same attribute in quotation.
so if the particular customer is selected then that table should be fetched.
I am using following script please suggest the changes
it’s not working
Hi @surajkumar,
I’ve not replicated and tested your code…but from looking at it, the “console.log” statement is placed wrongly, please delete that line and place in the curly bracket and test you code again.
I suggest something for you will help you to resolve your problem:
Instead of saying that it is not working, it is better to determine where exactly your code stuck and this can be by dividing your code into parts (comment part and leave part active) and step by step, until you reach for the sentence this is fail at it.
Also check browser console if you see any error (java error).
thank you @bghayad
yes I did it there is problem in callback function.
script is working for fetching the table of customer but that values are not reflected into quotation table.callback function has error. please suggest the changes
hello, @bomsy@bghayad
I have tried following script and its working but the only problem is now its fetching the all rows of the table but there are different data for different customer so when I select the customer then the the rows of data of that particular selected customer should be appear. I think there is problem in filters please suggest the suitable changes
Why you placed the filter inside the frappe.call and did not place at onload or setup event?
By the way: can you please pictures of the screen about what you are doing to understand what do you need exactly?
Regards
Bilal
I am quite new for this.
there is one table in customer for which new custom doctype is used named “Customer Items” and this table is to be fetch in quotation where I have created new table named"Customer Speacial ". by using above script that whole table is being fetched. but I want that whenever particular customer is selected the table values corresponding to that customer only should be added into the table which is created in quotation. by using current script without selecting customer the table value of all customer is added as shown in first screenshot whereas if I am selecting any xyz customer then the rows of values of that customer should be added into table
I have back up of all the customization. I will take care of it, for now I don’t want to upgrade.
I made the changes in code like I have passed customer argument in frappe.call but it is not working.
please rewrite your suggestion here if possible