Queries regarding Custom Scripts

Thanks Anand



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_fetch

Then use an image tag like:

<script>“<img src='” + doc.tool_type_image + “’ />”</script>

This should work…

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un…@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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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/-/l5aLqqc7RxwJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/8LE0_-NGWpUJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi,


I was wondering if it is possible to replace NULL or ZERO values in FLOAT with something else in a Query Report.

Basically currently my query is like this:

ifnull(tabItem.height_dia,“'”) as “H/D:Float:60”,

Now this runs good but I would want to replace the ZERO values as well with the same symbol but cannot seem to figure out the correct syntax.

I have tried this as well:

if(ifnull(tabItem.height_dia,“'”)==0,“'”, tabItem.height_dia) as “H/D:Float:60”,

But it does not seem to be working. Is this kind of a thing even possible since with all the ZEROS the things don’t look very elegant and are difficult to read in a report.

On Saturday, April 27, 2013 10:16:14 AM UTC+5:30, Aditya Duggal wrote:
Thanks Anand


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_fetch

Then use an image tag like:

<script>“<img src='” + doc.tool_type_image + “’ />”</script>

This should work…

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un…@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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/l5aLqqc7RxwJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/Pu8-TqUilUwJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Aditya,

Made an update so that null values are printed as empty strings instead of 0s. Will push it in sometime.

- Rushabh


On Wed, May 1, 2013 at 5:19 PM, Addy <ad...@rigpl.com> wrote:
Hi,

I was wondering if it is possible to replace NULL or ZERO values in FLOAT with something else in a Query Report.

Basically currently my query is like this:

ifnull(`tabItem`.height_dia,"'") as "H/D:Float:60",

Now this runs good but I would want to replace the ZERO values as well with the same symbol but cannot seem to figure out the correct syntax.

I have tried this as well:

if(ifnull(`tabItem`.height_dia,"'")==0,"'", `tabItem`.height_dia) as "H/D:Float:60",

But it does not seem to be working. Is this kind of a thing even possible since with all the ZEROS the things don't look very elegant and are difficult to read in a report.

On Saturday, April 27, 2013 10:16:14 AM UTC+5:30, Aditya Duggal wrote:
Thanks Anand


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_fetch

Then use an image tag like:

<script>"<img src='" + doc.tool_type_image + "' />"</script>

This should work...

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un…@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.

For more options, visit https://groups.google.com/groups/opt_out.








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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/l5aLqqc7RxwJ.

For more options, visit https://groups.google.com/groups/opt_out.








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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/Pu8-TqUilUwJ.

For more options, visit https://groups.google.com/groups/opt_out.














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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Dear Rushabh,

Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

Inline image 1



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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi Aditya,

Just use the if condition to set 0 values as null.

Thanks,
Anand.

On 02-May-2013, at 2:28 PM, Aditya Duggal <ad...@rigpl.com> wrote:

Dear Rushabh,

Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

<image.png>



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 er…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

if(`tabItem`.height_dia==0,"'", ifnull(`tabItem`.height_dia,"'")) as "H/D:Float:60"


On 02-May-2013, at 2:30 PM, Anand Doshi wrote:

Hi Aditya,

Just use the if condition to set 0 values as null.

Thanks,
Anand.

On 02-May-2013, at 2:28 PM, Aditya Duggal <ad...@rigpl.com> wrote:

Dear Rushabh,

Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

<image.png>



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 er…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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 er…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

I am using this code but I am getting a syntax error:

if(tabItem.no_of_flutes==0,“'”,ifnull(tabItem.no_of_flutes,“'”)) as “Zn:Float:30”,

Is there something that my code is missing from yours, I can’t seem to find the error but it is showing a syntax error. The whole code is here.


On Friday, May 3, 2013 11:15:22 AM UTC+5:30, Nabin Hait wrote:

if(tabItem.height_dia==0,“'”, ifnull(tabItem.height_dia,“'”)) as “H/D:Float:60”


On 02-May-2013, at 2:30 PM, Anand Doshi wrote:

Hi Aditya,

Just use the if condition to set 0 values as null.

Thanks,
Anand.

On 02-May-2013, at 2:28 PM, Aditya Duggal <ad…@rigpl.com> wrote:

Dear Rushabh,


Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

<image.png>



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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/NsIAjCrqTz4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Try this:

if(ifnull(`tabItem`.no_of_flutes, 0)=0, null, `tabItem`.no_of_flutes) as "Zn:Float:30"

Rushabh has done some changes in formatting of grid, such that it will show null values as blank. (You might need to update)

Thanks,
Anand. 

On 03-May-2013, at 3:05 PM, Aditya Duggal <ad...@gmail.com> wrote:

I am using this code but I am getting a syntax error:

if(`tabItem`.no_of_flutes==0,"'",ifnull(`tabItem`.no_of_flutes,"'")) as "Zn:Float:30",

Is there something that my code is missing from yours, I can't seem to find the error but it is showing a syntax error. The whole code is here.


On Friday, May 3, 2013 11:15:22 AM UTC+5:30, Nabin Hait wrote:
if(`tabItem`.height_dia==0,"'", ifnull(`tabItem`.height_dia,"'")) as "H/D:Float:60"


On 02-May-2013, at 2:30 PM, Anand Doshi wrote:

Hi Aditya,

Just use the if condition to set 0 values as null.

Thanks,
Anand.

On 02-May-2013, at 2:28 PM, Aditya Duggal <ad...@rigpl.com> wrote:

Dear Rushabh,

Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

<image.png>



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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/NsIAjCrqTz4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Dear Anand,

The code works fine, but it does not solve my purpose. Basically I don’t want blank fields in the report since I am not aware of searching for BLANK fields hence I wanted to replace all NULL and ZEROS with any character so that people could search for NULL fields as well and at the same time the report is not FILLED with data and hence a single digit to replace the NULL makes the report looks good and also makes the searching for the fields possible.

On Friday, May 3, 2013 3:12:14 PM UTC+5:30, Anand Doshi wrote:

Try this:

if(ifnull(tabItem.no_of_flutes, 0)=0, null, tabItem.no_of_flutes) as “Zn:Float:30”

Rushabh has done some changes in formatting of grid, such that it will show null values as blank. (You might need to update)

Thanks,
Anand. 

On 03-May-2013, at 3:05 PM, Aditya Duggal <ad…@gmail.com> wrote:

I am using this code but I am getting a syntax error:

if(tabItem.no_of_flutes==0,“'”,ifnull(tabItem.no_of_flutes,“'”)) as “Zn:Float:30”,

Is there something that my code is missing from yours, I can’t seem to find the error but it is showing a syntax error. The whole code is here.


On Friday, May 3, 2013 11:15:22 AM UTC+5:30, Nabin Hait wrote:
if(tabItem.height_dia==0,“'”, ifnull(tabItem.height_dia,“'”)) as “H/D:Float:60”


On 02-May-2013, at 2:30 PM, Anand Doshi wrote:

Hi Aditya,

Just use the if condition to set 0 values as null.

Thanks,
Anand.

On 02-May-2013, at 2:28 PM, Aditya Duggal <ad…@rigpl.com> wrote:

Dear Rushabh,


Basically I was looking to replace the blank field with ' since filtering for blank fields is difficult and I would also like to replace the 0.000 values as well with the ' or any other small value since they look very bad and unreadable. Here is a screen shot of the report:

<image.png>



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 er…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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 er…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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/-/NsIAjCrqTz4J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/Pq0ZzYgthzYJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

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_fetch

Then use an image tag like:

<script>“<img src='” + doc.tool_type_image + “’ />”</script>

This should work…

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un…@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.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





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/-/l5aLqqc7RxwJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




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 er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/zmnrZm82ih8J.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

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,
Rushabh




On 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_fetch

Then use an image tag like:

<script>"<img src='" + doc.tool_type_image + "' />"</script>

This should work...

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un…@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.



For more options, visit https://groups.google.com/groups/opt_out.








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/-/l5aLqqc7RxwJ.



For more options, visit https://groups.google.com/groups/opt_out.







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 er…@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/zmnrZm82ih8J.


For more options, visit https://groups.google.com/groups/opt_out.





--



Twitter: @rushabh_mehta



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 er...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi,

I would like to know if there is a way to hide a field irrespective of the fields current state (hidden or unhidden). The current toggle.display command only lets us change the display state and you can never be sure whether the item is being displayed or not.

Is there a command on client side script that I can use to explicitly hide or make mandatory certain fields.

I have checked the client side scripting help page and could not find anything there :(

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,
Rushabh




On 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_fetch

Then use an image tag like:

<script>"<img src='" + doc.tool_type_image + "' />"</script>

This should work...

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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.



For more options, visit https://groups.google.com/groups/opt_out.

 

 





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.



For more options, visit https://groups.google.com/groups/opt_out.

 

 




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.


For more options, visit https://groups.google.com/groups/opt_out.
 
 



--



Twitter: @rushabh_mehta



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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.

Hi Aditya,

cur_frm.toggle_field(“fieldname”, false) will hide the field :)

Essentially it sets the hidden property of the field to true.

body{font-family:Helvetica,Arial;font-size:13px}body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em; margin:auto; background:#fefefe; }

h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}

h1 {
color: #000000;
font-size: 28pt;
}

h2 {
border-bottom: 1px solid #CCCCCC;
color: #000000;
font-size: 24px;
}

h3 {
font-size: 18px;
}

h4 {
font-size: 16px;
}

h5 {
font-size: 14px;
}

h6 {
color: #777777;
background-color: inherit;
font-size: 14px;
}

hr {
height: 0.2em;
border: 0;
color: #CCCCCC;
background-color: #CCCCCC;
}

p, blockquote, ul, ol, dl, li, table, pre {
margin: 15px 0;
}

a, a:visited {
color: #4183C4;
background-color: inherit;
text-decoration: none;
}

#message {
border-radius: 6px;
border: 1px solid #ccc;
display:block;
width:100%;
height:60px;
margin:6px 0px;
}

button, #ws {
font-size: 12 pt;
padding: 4px 6px;
border-radius: 5px;
border: 1px solid #bbb;
background-color: #eee;
}

code, pre, #ws, #message {
font-family: Monaco;
font-size: 10pt;
border-radius: 3px;
background-color: #F8F8F8;
color: inherit;
}

code {
border: 1px solid #EAEAEA;
margin: 0 2px;
padding: 0 5px;
}

pre {
border: 1px solid #CCCCCC;
overflow: auto;
padding: 4px 8px;
}

pre > code {
border: 0;
margin: 0;
padding: 0;
}

#ws { background-color: #f8f8f8; }

table {
border-collapse: collapse;
font-family: Helvetica, arial, freesans, clean, sans-serif;
color: rgb(51, 51, 51);
font-size: 15px; line-height: 25px;
padding: 0; }

table tr {
border-top: 1px solid #cccccc;
background-color: white;
margin: 0;
padding: 0; }

table tr:nth-child(2n) {
background-color: #f8f8f8; }

table tr th {
font-weight: bold;
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr td {
border: 1px solid #cccccc;
margin: 0;
padding: 6px 13px; }

table tr th :first-child, table tr td :first-child {
margin-top: 0; }

table tr th :last-child, table tr td :last-child {
margin-bottom: 0; }

.send { color:#77bb77; }
.server { color:#7799bb; }
.error { color:#AA0000; }


Thanks,
Anand Doshi.

On 24 April 2014 at 4:46:22 pm, Aditya Duggal (ad…@gmail.com) wrote:

Hi,

I would like to know if there is a way to hide a field irrespective of the fields current state (hidden or unhidden). The current toggle.display command only lets us change the display state and you can never be sure whether the item is being displayed or not.

Is there a command on client side script that I can use to explicitly hide or make mandatory certain fields.

I have checked the client side scripting help page and could not find anything there :(

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,
Rushabh




On 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_fetch

Then use an image tag like:

<script>"<img src='" + doc.tool_type_image + "' />"</script>

This should work...

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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
.


For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
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/-/l5aLqqc7RxwJ
.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--



Twitter: @rushabh_mehta
--
Note:
 
If you are posting an issue,
1. 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.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. 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.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/etPan.53590ed4.515f007c.1e2%40apdmacbook.local.

    For more options, visit https://groups.google.com/d/optout.
Perfect

Thanks alot.

On Thursday, April 24, 2014 6:47:08 PM UTC+5:30, Anand Doshi wrote:

Hi Aditya,

cur_frm.toggle_field(“fieldname”, false) will hide the field :)

Essentially it sets the hidden property of the field to true.


Thanks,
Anand Doshi.

On 24 April 2014 at 4:46:22 pm, Aditya Duggal (ad...@gmail.com) wrote:

Hi,

I would like to know if there is a way to hide a field irrespective of the fields current state (hidden or unhidden). The current toggle.display command only lets us change the display state and you can never be sure whether the item is being displayed or not.

Is there a command on client side script that I can use to explicitly hide or make mandatory certain fields.

I have checked the client side scripting help page and could not find anything there :(

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,
Rushabh




On 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_fetch

Then use an image tag like:

<script>"<img src='" + doc.tool_type_image + "' />"</script>

This should work...

best,
Rushabh




W: https://erpnext.com
T: @rushabh_mehta

On 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+un...@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
.


For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
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
er…@googlegroups.com.


To view this discussion on the web visit
https://groups.google.com/d/msg/erpnext-developer-forum/-/l5aLqqc7RxwJ
.


For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/zmnrZm82ih8J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--



Twitter: @rushabh_mehta
--
Note:
 
If you are posting an issue,
1. 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.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. 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.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/a80d3381-4d9a-472d-9f95-7c91d3fd294c%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Aditya,

     I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Can you share your script via pastebin so we can check what you have done.



@rushabh_mehta

On 17-May-2014, at 7:16 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Aditya,

     I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/4DF76766-DBE6-4AD7-8444-363A5EB9A868%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Rushabh!

      This is the code snippet I made to try to hide the field. What do I need to work properly?


    cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query = function(doc,doctype,docname) {
       return "SELECT ..., default_warehouse,... FROM `tabItem` WHERE ...;
    };

    cur_frm.add_fetch('item_code', 'default_warehouse', 'item_kind');

    var hideField = cur_frm.fields_dict['quotation_details'].grid.get_field('item_kind').value=="Accommodation";

    // the field 'nights_number' is in a grid 'quotation_details', how can hide the field? The field is not present in a principal form.
    cur_frm.toggle_display("nights_number", hideField);   // doesn't work!

Thanks,
Edney


Em sábado, 17 de maio de 2014 07h02min00s UTC-3, rushabh escreveu:
Can you share your script via pastebin so we can check what you have done.



@rushabh_mehta

On 17-May-2014, at 7:16 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Aditya,

     I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/4c5bd6bc-63c7-4a21-9e50-1685e989facf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Edney, this is very hard to read. Can you share via pastebin or gist.github.com



@rushabh_mehta

On 19-May-2014, at 7:25 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Rushabh!

      This is the code snippet I made to try to hide the field. What do I need to work properly?


    cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query = function(doc,doctype,docname) {
       return "SELECT ..., default_warehouse,... FROM `tabItem` WHERE ...;
    };

    cur_frm.add_fetch('item_code', 'default_warehouse', 'item_kind');

    var hideField = cur_frm.fields_dict['quotation_details'].grid.get_field('item_kind').value=="Accommodation";

    // the field 'nights_number' is in a grid 'quotation_details', how can hide the field? The field is not present in a principal form.
    cur_frm.toggle_display("nights_number", hideField);   // doesn't work!

Thanks,
Edney


Em sábado, 17 de maio de 2014 07h02min00s UTC-3, rushabh escreveu:
Can you share your script via pastebin so we can check what you have done.



@rushabh_mehta

On 17-May-2014, at 7:16 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Aditya,

     I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/4c5bd6bc-63c7-4a21-9e50-1685e989facf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8AA39814-181F-4468-B958-8D50080C7655%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Hi Rushabh!

      This is my code: http://pastebin.com/ffA0W3jV

      When the field 'tipo_item' changes the scripts works fine, but when the form opens for editing the code is not executed and therefore the field "noites_hospedagem" is visible when it should be invisible. What do I need to modify to work correctly in this case?

Thanks,
Edney

Em segunda-feira, 19 de maio de 2014 02h17min40s UTC-3, rushabh escreveu:
Edney, this is very hard to read. Can you share via pastebin or gist.github.com



@rushabh_mehta

On 19-May-2014, at 7:25 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Rushabh!

      This is the code snippet I made to try to hide the field. What do I need to work properly?


    cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query = function(doc,doctype,docname) {
       return "SELECT ..., default_warehouse,... FROM `tabItem` WHERE ...;
    };

    cur_frm.add_fetch('item_code', 'default_warehouse', 'item_kind');

    var hideField = cur_frm.fields_dict['quotation_details'].grid.get_field('item_kind').value=="Accommodation";

    // the field 'nights_number' is in a grid 'quotation_details', how can hide the field? The field is not present in a principal form.
    cur_frm.toggle_display("nights_number", hideField);   // doesn't work!

Thanks,
Edney


Em sábado, 17 de maio de 2014 07h02min00s UTC-3, rushabh escreveu:
Can you share your script via pastebin so we can check what you have done.



@rushabh_mehta

On 17-May-2014, at 7:16 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Aditya,

     I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/4c5bd6bc-63c7-4a21-9e50-1685e989facf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/92c10c68-16ea-45c3-8f21-ec167b59ce01%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

You should call the function `cur_frm.cscript.tipo_item` from `cur_frm.cscript.custom_refresh`.

And that get_query statement should be declared outside tipo_item trigger function.

On 23 May 2014 09:52, "Edney Oliveira" <ed...@gmail.com> wrote:
Hi Rushabh!


When the field 'tipo_item' changes the scripts works fine, but when the form opens for editing the code is not executed and therefore the field "noites_hospedagem" is visible when it should be invisible. What do I need to modify to work correctly in this case?

Thanks,
Edney

Em segunda-feira, 19 de maio de 2014 02h17min40s UTC-3, rushabh escreveu:
Edney, this is very hard to read. Can you share via pastebin or gist.github.com



@rushabh_mehta

On 19-May-2014, at 7:25 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Rushabh!

This is the code snippet I made to try to hide the field. What do I need to work properly?


cur_frm.fields_dict['quotation_details'].grid.get_field('item_code').get_query = function(doc,doctype,docname) {
return "SELECT ..., default_warehouse,... FROM `tabItem` WHERE ...;
};

cur_frm.add_fetch('item_code', 'default_warehouse', 'item_kind');

var hideField = cur_frm.fields_dict['quotation_details'].grid.get_field('item_kind').value=="Accommodation";

// the field 'nights_number' is in a grid 'quotation_details', how can hide the field? The field is not present in a principal form.
cur_frm.toggle_display("nights_number", hideField); // doesn't work!

Thanks,
Edney


Em sábado, 17 de maio de 2014 07h02min00s UTC-3, rushabh escreveu:
Can you share your script via pastebin so we can check what you have done.



@rushabh_mehta

On 17-May-2014, at 7:16 am, Edney Oliveira <ed...@gmail.com> wrote:

Hi Aditya,

I have the same problem, but the field that I want to hide is in a grid. Your example didn't work in this case. How can I hide the field in a grid?

Thanks!
Edney

Em quarta-feira, 27 de fevereiro de 2013 02h44min12s UTC-3, rushabh escreveu:
Aditya,

Check the first example:


You can also use this to set the "hidden" property of docfield (df).

best,
Rushabh


W: https://erpnext.com
T: @rushabh_mehta

On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I have some queries with regards to custom scripts:

  1. I am trying to make certain fields in the item master as "READ-ONLY" but after the creation of item codes. Since my item codes would be dependent on these fields and to maintain the integrity of the items I would like to lock these fields using the custom script. Kindly let me know how to achieve this by using custom reports.
  2. Is there a way to show certain fields on screen at the time of item creation since they are the ones according to which the item code is created, something on the lines of the item variant which is long pending but now I am trying to prepare one myself.





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 er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/roI6wXRFBVIJ.

For more options, visit https://groups.google.com/groups/opt_out.








Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/8c76464b-73cb-41d3-83f2-c80210242daf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.





Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/4c5bd6bc-63c7-4a21-9e50-1685e989facf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:



If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/92c10c68-16ea-45c3-8f21-ec167b59ce01%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/CA%2BCj7ti_SR6n-Wx5XiXNoQom1eVY_0ZGsKxWA_cBKuoOD-TgTA%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.