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

Add image in Custom Form


#1

When I made production plan item in custom field like below.

Production plan item is been like bellow. Item image not seen.

I want to see item image in this field. How I can fix this problem?


#2

Do you want to attach an Image on this doctype or do you wish to pull the image link from item master? Maybe some clarity on this would help someone answer your question.


#3

I can already attach image. But I want to take image automatically according to item image. I think this is that pulling image link from item master.


#4

How I can fetch item image in production plan item?


#5

No one to help?


#6

Hello @alimert801
First you need to correct the option of the field image_view to be image instead of Image (because your attach field name is image and not Image).
Second, you need to use this code in the js:
cur_frm.add_fetch(‘item_code’, ‘image’, ‘image’)

I am assuming that your fields (image_view and image) are existed in the Production Plan Item child doctype.

Regards
Bilal


#7

I cant understand second. I add code in custom script i hope this is true.
I made like below. But it didnt work.


#8

I cant understand second. I add code in custom script i hope this is true.

I was mean to add the javascript code, and you already did this in the custom script, also you can do this in the javascript file (it is possible in javascript or in the custom script).

Regarding to the custom script that you added, please you need to place the ) in the end of the line as I see in the picture that u attached, it is missing the) in the end of the code.

Regards
Bilal


#9

Thank you so much it is work. I used custom script add in ‘Production Plan’.

I use this code material request plan item it works but there is a problem.

I show problem in this video:

Video