On Saturday, May 4, 2013 2:31:53 PM UTC+5:30, rushabh wrote:
Aditya,You can update explicitly using the update query in Server Custom Script of Tool Type. Joins are not bad if you are joining once or twice :)best,RushabhOn Fri, May 3, 2013 at 7:45 PM, Aditya Duggal <ad...@gmail.com> wrote:Hi Anand,
I am using this in my print format:
<script>"<img src='" + doc.dim_image_list + "' style='width: 500px; height: 250px'/>"</script>
Also I am getting this field from the server side scripting by the below code:
self.doc.dim_image_list = webnotes.conn.get_value("File Data", {"attached_to_doctype": "Tool Type", "attached_to_name": self.doc.tool_type}, "file_url")
But the problem is that if I change the image in the TOOL TYPE the effects would not reflect until I edit and save an item. Is there any way I could get the updated image on the print format of an item as soon as the image on the TOOL TYPE is CHANGED or do I have to do a UPDATE of the DB from the SYSTEM CONSOLE every time I change the image and if that is the only thing possible then should this code work on the backend:
webnotes.conn.sql("UPDATE `tabItem` SET dim_image_list = `tabFile Data`.file_url WHERE `tabFile Data`.attached_to_doctype = 'Tool Type' AND `tabFile Data`.attached_to_name = `tabItem`.tool_type")
But I guess this is wrong since I would need to join the tables and honestly the JOINS scare the hell out of me since I tried it once and you all were forced to throw my account out of erpnext (just joking).
Hence I request you to kindly let me know how to join the 2 tables or is there a better way to get the updated image automatically.
On Friday, April 26, 2013 8:17:20 PM UTC+5:30, Anand Doshi wrote:Hi Aditya,You can put that in the style attribute of img.<script>"<img src='" + doc.tool_type_image + "' style='width: 200px; height: 100px' />"</script>Thanks,Anand.On 26-Apr-2013, at 8:14 PM, Aditya Duggal <ad...@gmail.com> wrote:Thanks rushabh,It works perfectly. Just one more thing how could I add the height and width to control those things. I tried various combos but none seems to work.
On Friday, April 26, 2013 5:22:32 PM UTC+5:30, rushabh wrote:Aditya,webnotes.client.get_value is a server side function.You will need the value (tool_type_image) in your current transaction using add_fetchThen use an image tag like:<script>"<img src='" + doc.tool_type_image + "' />"</script>This should work...best,RushabhW: https://erpnext.com
T: @rushabh_mehtaOn 26-Apr-2013, at 3:41 PM, Aditya Duggal <ad...@gmail.com> wrote:Hi,I need to pull an image in a print format from a different doctype. I have tried using this<script>webnotes.client.get_value("Tool Type", doc.tool_type, "image")</script>But this is not helping me out can you suggest a code hidden in the client side so that I could fetch a photo attached to a doctype.
On Friday, April 19, 2013 2:37:39 PM UTC+5:30, Addy wrote:Hi Anand,Thanks you very much for the NO COPY code it should solve a lot of problems for me. As for the file list I can definitely wait and I guess I would be letting it sleep till the time new release are made and as for the image placeholder I think Umair gave me a very simple solution of opening the attachment which I don't know why I did not think of and hence I guess the placeholder part is also done.Once again thanks a lot for all the help you people have been offering.–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr…@googlegroups.com.
To post to this group, send email to er…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/BkXD_-W0XSkJ.–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr…@googlegroups.com.
To post to this group, send email to erpnext-dev…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/l5aLqqc7RxwJ.–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.To post to this group, send email to erpnext-dev…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/zmnrZm82ih8J.--Twitter: @rushabh_mehta
–
Note:
If you are posting an issue,
- We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
- Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
- For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8353f8d1-b835-4529-ab61-0d404c4228da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.