Another Small query, how do I set the default value of a field on loading of a form. Basically, I want to remove old data entered if a certain field is hidden so that the old does not get into the table creating redundant data.
Also I would like to show some pictures based on the selection field. Is it possible to fetch some picture based on a field change.
On Wednesday, April 17, 2013 1:45:25 PM UTC+5:30, Anand Doshi wrote:
Hi Aditya,
Why not shift the conditions from depends_on to custom script? That way you can specify to display and make it mandatory in one shot.
Thanks,
Anand.
On 17-Apr-2013, at 1:42 PM, Aditya Duggal <ad…@gmail.com> wrote:
Is it possible to make a field mandatory based on its visibility? I have certain fields which become hidden or visible based on eval property of customise form view.
Now what I want is that a field becomes mandatory if it is visible. Kindly let me know if this kind of a thing is possible.
On Tuesday, April 9, 2013 10:48:34 PM UTC+5:30, Aditya Duggal wrote:
Hi Nabin,
I have been able to get rid of the error, thanks you for the code. I think there seems to be a problem with the next serial code since my item codes are not getting the next serial number after the code. Also I have added the code to add a check digit at the end of the item code which might be creating some problem kindly let me know what have I done wrong. I have updated the gist with a fork here.
On Tuesday, April 9, 2013 5:29:46 PM UTC+5:30, Nabin Hait wrote:
Hi Aditya,
In python, “Indentation” is very important, based on that it decide the block of statements. Please check the indentation.
And you should use either Space or Tab, for indentation.
You can fetch any value entered by the user in server script, using self.doc.fieldname
Excluding uppercase letters and I, O, 0 is very difficult to implement, it breaks normal alphanumeric addition. Regarding 3 digit naming, you are entering the serial no in item group manually, so try to limit to 3 digit there.
Tried to run this code on my test account and I am getting a error in loading a script whch says "Error in script while loading" when I click on an item. The error code I am getting is as below:
[13:43:06.051] Traceback (innermost last): File "../lib/webnotes/widgets/form/load.py", line 83, in load_single_doc dl = webnotes.bean(dt, dn).doclist File "../lib/webnotes/__init__.py", line 307, in bean return Bean(doctype, name) File "../lib/webnotes/model/bean.py", line 54, in __init__ self.load_from_db(dt, dn) File "../lib/webnotes/model/bean.py", line 80, in load_from_db self.run_method("onload") File "../lib/webnotes/model/bean.py", line 214, in run_method self.make_obj() File "../lib/webnotes/model/bean.py", line 103, in make_obj self.obj = webnotes.get_obj(doc=self.doc, doclist=self.doclist) File "../lib/webnotes/__init__.py", line 292, in get_obj return get_obj(dt, dn, doc, doclist, with_children) File "../lib/webnotes/model/code.py", line 156, in get_obj return get_server_obj(doc, doclist) File "../lib/webnotes/model/code.py", line 108, in get_server_obj exec custom_class + custom_script.replace('\t',' ') in locals() File "<string>", line 29 return strip_zs[:-1] + chr(ord(strip_zs[-1]) + 1) + 'a' * (len(s) - len(strip_zs)) ^ IndentationError: expected an indented block
Traceback (innermost last): File "../lib/webnotes/handler.py", line 156, in handle execute_cmd(cmd) File "../lib/webnotes/handler.py", line 191, in execute_cmd ret = call(method, webnotes.form_dict) File "../lib/webnotes/handler.py", line 208, in call return fn(**newargs) File "../lib/webnotes/widgets/form/load.py", line 43, in getdoc doclist = load_single_doc(doctype, name, user or webnotes.session.user) File "../lib/webnotes/widgets/form/load.py", line 87, in load_single_doc raise e File "<string>", line 29 return strip_zs[:-1] + chr(ord(strip_zs[-1]) + 1) + 'a' * (len(s) - len(strip_zs)) ^ IndentationError: expected an indented block
Also I would like to ask a few more questions:
if it is possible to fetch the field entered by the user in the server script then I would easily be able to generate the item code.
how could I change the above code to only generate 3-digit series only using numbers 1-9 and capital letters. Please note that I am planning to omit the following characters from the item code 0 (Zero), I and O.
I am sorry to ask so many simple questions since this is the first time I have had my tryst with Python code anyhow I have already started to read about python code as well now. Hope you would show me the right path to follow.
On Tuesday, April 2, 2013 11:45:01 PM UTC+5:30, Nabin Hait wrote:
Hi Aditya,
Instead of doing client side scripting, if you do it in server side script (python), then life will be lot easier.
Thanks for the earlier suggestion of after save it works as always. As for the naming series system, I have come up with a new naming system which is very small, I am more inclined in using the 3 digits for the serial number so that the item code remains small. My target is to get the item codes to less than 10-digits or at max 10 digits with a check digit for which I would be posting a query.
I guess with these constraints I cannot go for numeric serial number since 5-digit numeric serial number only saves 99,999 records whereas with alphanumeric series I could save 46,656 (36^3) records in just 3 digits. Also I am planning to remove the confusing letters or digits vis-a-vis I,O and 0. Which means I can store upto 35,937 (33^3) records in 3 digit serial number.
Also this new item coding which I am planning should be sufficient for my company even if we go beyond a million item codes and I am hoping that this project of sorts would be a one time effort for a long time to come. I am planning to share this thing in a blog once I am satisfied with things since with my case I am the coder and the user as well.
I hope there must be a way to manage the series via item group.....please don't tell me that it is not possible since I am banking on this part of the code and I am continuing my work, hoping that I would get a solution from your end in a day or two.
On Tuesday, April 2, 2013 8:09:11 PM UTC+5:30, Anand Doshi wrote:
Hi Aditya,
Scratch that. I think I have a better solution to your item code woes. It is about playing a trick on the naming series system.
Hopefully, it should work. You can try this out in your test environment:
1. Create a custom field in item with label "Naming Series" and field type = "Data".
It will create a field with field name = "naming_series". (You may mark it as Mandatory after testing if it works)
2. In your URL, type this after app.html - "#List/Property Setter".
Click on New to create a new Property Setter and enter the following:
DocType or Field = DocType
DocType = Item
Property = auto name
Property Type = Data
Set Value = naming_series:
make sure to type that colon at the end of naming_series
Save this Property Setter
3. So now that the ground is set, all you have to do is before saving (in custom_validate), make sure that Naming Series is set to your codification system like ITEM_GROUP_NAME-SOME_OTHER_VARIABLE-
and when saving, it will keep track of the number for that series ITEM_GROUP_NAME-SOME_OTHER_VARIABLE-
So, if you are saving the first item of the series, ITEM_GROUP_NAME-SOME_OTHER_VARIABLE- then it will be named as ITEM_GROUP_NAME-SOME_OTHER_VARIABLE-00001
The only constraint here is that the number will be of 5 digits, since this is the way naming series works in ERPNext.
I think it is a better way to keep track of your series instead of updating Item Group after saving every Item.
Developer documentation needs a lot of work. It's one of the items which we are gonna take up next since auto inventory accounting is almost done.
I think you can try using
cur_frm.cscript.after_save = function() {
}
I am not so sure about it. Will need to check the code since it is rarely used.
Sent from my phone
On 02-Apr-2013, at 7:27 PM, Aditya Duggal <ad...@gmail.com> wrote:
Thanks Anand for the quick response. Works like a jiffy.
Also where can I access all the coding options of wnframework since I need to know if I could control a code to run only after successful saving of a document since my counter seems to be running even if there is an error in saving a new document.
On Tuesday, April 2, 2013 6:42:01 PM UTC+5:30, Anand Doshi wrote:
Use this in custom_validate
if(cur_frm.doc.__islocal) {
// your code here
}
Sent from my phone
On 02-Apr-2013, at 6:38 PM, Aditya Duggal <ad...@gmail.com> wrote:
Another thing I wanted to know which is not mentioned in the wiki is that what code should I use if I want a code to be initiated only at the time of creating a document currently I am using some code under
cur_frm.cscript.custom_validate = function(doc) {
But this code also runs if I make some changes to an existing document, whereas my need is to run some particular code only at the time of creation of the document.
Is there any solution for that?
On Tuesday, April 2, 2013 12:07:50 PM UTC+5:30, Aditya Duggal wrote:
Hi,
I have update the code in the gist the updated code is here. Now the code is working fine but the only things which are not working are:
I am unable to fetch Serial Number properly from the Item Group in a Item Code
Unable to update the serial number in the item group of the item.
Also I am facing a peculiar problem, if for some reason the item is not saved the counter of the serial number still keeps on running so if the serial number is 111 and if we face the did not save error for 3 times then the next time the serial number becomes 115 instead of 111. So the code is not exiting at the time of the did not save.
Kindly please help me with the small modifications so that I could continue with my work.
On Monday, April 1, 2013 6:39:47 PM UTC+5:30, Aditya Duggal wrote:
Hi,
I am almost there with this custom script and its understanding but currently I am having an issue with the client side script. Can you please let me know what is the error in this client script
What is this script doing?
Fetch values from the item group selected line 1~8
Function to generate the alphanumeric key line 11~17
Code to disable fields after saving line 19~24
Fetch the field serial_number mentioned in the item group selected and then assign the item code with that serial number line 26~48
Update the serial number with the next value in the series in the ITEM GROUP which has been selected line 50~56
Kindly let me know what is wrong with the code since I am unable to perform the tasks mentioned in the code.
On Monday, April 1, 2013 4:23:14 PM UTC+5:30, Aditya Duggal wrote:
Thanks Nabin
I have one more query which I have posted in stackoverflow maybe it might interest you regarding the creation of an alphanumeric key, the link for the question is this
On Monday, April 1, 2013 4:07:14 PM UTC+5:30, Nabin Hait wrote:
On 25-Feb-2013, at 4:08 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi,
I have some queries with regards to custom scripts:
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.
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.
Another Small query, how do I set the default value of a field on loading of a form. Basically, I want to remove old data entered if a certain field is hidden so that the old does not get into the table creating redundant data.
Every field has a “default” property - you can set it in Customize Form View
Also I would like to show some pictures based on the selection field. Is it possible to fetch some picture based on a field change.
In Image field, in the options property, set the fieldname of the image url.
To make a file “Select” set, “attach_files:” in the options property.
Thanks for the suggestion, basically regarding the default values, they only work in case a new transaction or master is being made vide the make new option. But the defaults does not load if we copy an existing transaction or master and for that thing there is no copy which is not accessible to users, even if I make the changes directly to the doctype then I know that the fields would be reset to the default once an update come.
As for the attaching of image automatically, I was not able to find the part in the item.js but I was able to find something on the wiki and I am using this to update the image on client side by using the below code but it does not update the same, let me know what is wrong since the error I am receiving is
Also is there a way to change the size of the image place holder since the default size of the image place holder is small for the purpose for which I am using. If we cannot change the default image placeholder size then is it possible to add a custom field of image placeholder and change the size either via customise form view or via a script.
On Friday, April 19, 2013 10:05:30 AM UTC+5:30, rushabh wrote:
> Another Small query, how do I set the default value of a field on loading of a form. Basically, I want to remove old data entered if a certain field is hidden so that the old does not get into the table creating redundant data.
Every field has a “default” property - you can set it in Customize Form View
> Also I would like to show some pictures based on the selection field. Is it possible to fetch some picture based on a field change.
In Image field, in the options property, set the fieldname of the image url.
To make a file “Select” set, “attach_files:” in the options property.
(See “Item” for how its done)
–
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
You can use write code to clear desired fields in:
cur_frm.cscript.custom_onload = function() {
var fields = ["field1", "field2"];
for(var i in fields) {
cur_frm.set_value(fields[i], "");
}
};
FILE LIST
We are going to release a file manager and we have changed a lot of code. Can you wait for next week for this customisation? It will avoid repetition of work.
Also, you will need to write server side code for this.
PLACEHOLDER
Such a feature is not a priority. Also, I am unable to understand why do you want this feature. If you intend to print the item's page, better make a custom Print Format and specify the size in it. Playing with the form elements can only cause problems in future, when we do any changes in the layout.
Thanks,
Anand.
On 19-Apr-2013, at 12:26 PM, Aditya Duggal <ad...@gmail.com> wrote:
Hi Rushabh,
Thanks for the suggestion, basically regarding the default values, they only work in case a new transaction or master is being made vide the make new option. But the defaults does not load if we copy an existing transaction or master and for that thing there is no copy which is not accessible to users, even if I make the changes directly to the doctype then I know that the fields would be reset to the default once an update come.
As for the attaching of image automatically, I was not able to find the part in the item.js but I was able to find something on the wiki and I am using this to update the image on client side by using the below code but it does not update the same, let me know what is wrong since the error I am receiving is
Also is there a way to change the size of the image place holder since the default size of the image place holder is small for the purpose for which I am using. If we cannot change the default image placeholder size then is it possible to add a custom field of image placeholder and change the size either via customise form view or via a script.
On Friday, April 19, 2013 10:05:30 AM UTC+5:30, rushabh wrote:
> Another Small query, how do I set the default value of a field on loading of a form. Basically, I want to remove old data entered if a certain field is hidden so that the old does not get into the table creating redundant data.
Every field has a "default" property - you can set it in Customize Form View
> Also I would like to show some pictures based on the selection field. Is it possible to fetch some picture based on a field change.
In Image field, in the options property, set the fieldname of the image url.
To make a file "Select" set, "attach_files:" in the options property.
(See "Item" for how its done)
–
You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.
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.
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.
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.
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.
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.
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.
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:
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.
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:
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.
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:
–
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
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.
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.
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.
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.
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.
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:
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.
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:
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.