ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Problem fetching the data from the module


#1

Hi,
thanks all for this AMAZING discuss i learn a lot from it and i hope i can help anyone here
i have been trying lots of solution have been giving here for fetching the data from another doctype
but it doesnt show and also it doesnt give me any error
i have Field in (Item) field name is (slump) i also created a read only field in the delivery note (slump)
cur_frm.add_fetch(Item, slump, slump);
cur_frm.add_fetch("Item", "slump", "slump");
cur_frm.set_value('item' , 'slump' , 'slump');
nothing from these worked for me
also i wanted to know where i can learn all of this coding for fetching data because i go to frappe framework
and i didnt see anything there according this command and scripts
thanks


#2

@Coders

Try below code in the delivery note custom script

cur_frm.add_fetch("item_code", "slump", "slump");

#3

@rohit_w ,
thanks for your responding but its still not working


#4

where do you have field “slump” in delivery note or delivery note items table?
I think it’s better to have it in Delivery Note items table.
and this code should be working:

cur_frm.add_fetch("item_code", "slump", "slump");


#5

@NMyshuk
Thanks for your responding its in delivery note items table


#6

and when you choose item with slump value it isn’t fetched?


#7

yes it does not fetch


#8

where did you added the script?


#9

in the delivery note


#10

sorry I cann’t help you, it works from my side


#11

Can you share the screenshot of your custom script?


#12

@rohit_w
thanks for your respond
i already make another field called operation section because i thought maybe the problem was in the field but it is still the same here is the screen shot for the source field and the target field and the custom script
thank you


#13

@Coders

You have created custom script for delivery note item, it should be delivery note.


#14

@rohit_w
yes i want it to be in delivery note item


#15

@Coders

Yes, but the doctype in the custom script should be delivery note. Make custom script for delivery note and add above add_fetch code.