Calculate Fields

Hi ERPnext, 

How can we calculate several custom int fields or data fields? 

I tried to find an answer in your group but i didn't found anything. 

Also in your guide. 

Thanks



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/984e9427-d09b-4a03-87f0-4f6b0ddc8718%40googlegroups.com.

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



On 17-Sep-2014, at 2:29 am, Antreas A <ar...@gmail.com> wrote:

Hi ERPnext, 

How can we calculate several custom int fields or data fields? 

I tried to find an answer in your group but i didn't found anything. 

On the client side, use Custom Scripts:

https://erpnext.com/user-guide/customize-erpnext/custom-scripts/custom-script-examples/generate-item-code-based-on-custom-logic


Also in your guide. 

Thanks



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/984e9427-d09b-4a03-87f0-4f6b0ddc8718%40googlegroups.com.

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




You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/4244278B-8F67-433B-965F-5424C65D00F4%40gmail.com.

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

Hi Antreas,

I am using this custom client script as below, maybe this helps a bit:

function inch_mm(mmfd, inchfd){
cur_frm.set_value(mmfd,"");
cal = Math.round(eval(inchfd) * 25400)/1000;
if (cal >0){
cur_frm.set_value(mmfd, cal);
}
else{
frappe.throw("Enter valid fraction in field, if you want to add \
inches greater than 1 then use 1+3/4 for 1.75 \
inch instead of 1-3/4");
}
}

//Calling the function is like this:

cur_frm.cscript.l2_inch = function(doc) {
var mmfd = "l2";
var inchfd = doc.l2_inch
inch_mm(mmfd,inchfd);
}



On Wednesday, September 17, 2014 11:11:05 AM UTC+5:30, Rushabh Mehta wrote:


On 17-Sep-2014, at 2:29 am, Antreas A <ar...@gmail.com> wrote:

Hi ERPnext, 

How can we calculate several custom int fields or data fields? 

I tried to find an answer in your group but i didn't found anything. 

On the client side, use Custom Scripts:



Also in your guide. 

Thanks



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/984e9427-d09b-4a03-87f0-4f6b0ddc8718%40googlegroups.com.

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




You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/41869683-f081-44c2-bbd7-c940a4f8fd40%40googlegroups.com.

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