Need to change the quality inspection reading fields labels based on parameter field

Hi;


I need to change the fields Labels (Reading 1, Reading 2, Reading 3, …) in the Quality inspection readings document based on entered data in the parameter field in the same doc.

(custom script) how ?

Thanks.

HF



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

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

 

 

HF,

You can go to Customize Form View and change labels in "Quality Inspection Reading"

best,
Rushabh


On Thu, Apr 4, 2013 at 7:32 PM, HF <h....@gmail.com> wrote:
Hi;

I need to change the fields Labels (Reading 1, Reading 2, Reading 3, ....) in the Quality inspection readings document based on entered data in the parameter field in the same doc.

(custom script) how ?

Thanks.

HF



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

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 need it to be dynamically change when the user change the parameter field or the naming series field in the same screen.

Lets say if the user choose naming series QA/  the labels for the specification details table for Reading 1, Reading 2, … will be xxx1 , xxx2, …
and if the user chooses naming series QB/  the labels for the specification details table for Reading 1, Reading 2, … will be yyy1 , yyy2, …

Thanks.




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/-/IXvecd-3kloJ.

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

 

 

Hisham,

Sorry for the late reply.

This is not possible unless you write a complex custom script to change the labels. There is such a script for Sales Order where we change the table headings based on currency.

https://github.com/webnotes/erpnext/blob/master/selling/doctype/sales_common/sales_common.js#L101

This basically involves identifying the column heading using jquery and then changing the label in the HTML dom.

You can use the technique in custom script and give it a shot.

best,
Rushabh




On Fri, Apr 5, 2013 at 5:06 PM, HF <h....@gmail.com> wrote:
Hi ;

I need it to be dynamically change when the user change the parameter field or the naming series field in the same screen.

Lets say if the user choose naming series QA/ the labels for the specification details table for Reading 1, Reading 2, ... will be xxx1 , xxx2, ....
and if the user chooses naming series QB/ the labels for the specification details table for Reading 1, Reading 2, ... will be yyy1 , yyy2, ....

Thanks.




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/-/IXvecd-3kloJ.

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.

 

 

Dear Rushabh;


I tried this in the custom script but it doen’t work:

cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
     inspection_cols_base = {‘reading_1’: ‘xxx1’, ‘reading_2’: ‘xxx2’, ‘reading_3’: ‘xxx3’, ‘reading_4’: ‘Reading 4’, ‘reading_5’: ‘Reading 5’, ‘reading_6’: ‘Reading 6’, ‘reading_7’: ‘Reading 7’, ‘reading_8’: ‘Reading 8’, ‘reading_9’: ‘Reading 9’, ‘reading_10’: ‘Reading 10’};
    for (d in inspection_cols_base) $(’[data-grid-fieldname="’+cur_frm.cscript.tname+’-’+d+’"]’).html(inspection_cols_base[d]);
    var hide = (doc.naming_series == ‘QA’) ? false : true;
for (f in inspection_cols_base) {
cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide);
}
        callback(doc, cdt, cdn);
}
cur_frm.cscript.naming_series = cur_frm.cscript.dynamic_label;


Please advise.

Thanks.


 



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/-/VaW-BW-30AsJ.

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

 

 

HF,

I have made the following gist based on your requirements.

https://gist.github.com/nabinhait/5335620

I have not tested the code, please change as per your requirement and test it.

Regards,
Nabin Hait

On 08-Apr-2013, at 1:30 PM, HF wrote:

Dear Rushabh;

I tried this in the custom script but it doen't work:

cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) {
     inspection_cols_base = {'reading_1': 'xxx1', 'reading_2': 'xxx2', 'reading_3': 'xxx3', 'reading_4': 'Reading 4', 'reading_5': 'Reading 5', 'reading_6': 'Reading 6', 'reading_7': 'Reading 7', 'reading_8': 'Reading 8', 'reading_9': 'Reading 9', 'reading_10': 'Reading 10'};
    for (d in inspection_cols_base) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(inspection_cols_base[d]);
    var hide = (doc.naming_series == 'QA') ? false : true;
for (f in inspection_cols_base) {
cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide);
}
        callback(doc, cdt, cdn);
}
cur_frm.cscript.naming_series = cur_frm.cscript.dynamic_label;


Please advise.

Thanks.


 



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/-/VaW-BW-30AsJ.

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 Nabin;


It works from first time,… well done Nabin it solves me a complicated problem.

Thanks.



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

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

 

 

Hi Nabin,

I just tried this thing to change my labels in Item Page but I am unable to get the desired results, there is no error but the function is giving me a alert as desired but the Labels are not changing.

My code is here.

Now I have called the function to change the labels on line# 84 and the function to change the labels start from line# 298

Now the problem is that function is being called correctly and I am also able to see the correct labels in the ALERT message on line 307 and 308 but the actual labels of the field are unchanged....I know I am missing something but I am not able to find what?

I have taken cue from your gist here.



On Monday, April 8, 2013 7:50:37 PM UTC+5:30, HF wrote:
Dear Nabin;

It works from first time,... well done Nabin it solves me a complicated problem.

Thanks.



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/3116006a-d760-4731-87bc-8512716fc76b%40googlegroups.com.

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

To change label, use:

cur_frm.set_df_property("fieldname", "label", "My Label")


Try it from your console first to check if it works.

best,
Rushabh


On Friday, April 25, 2014 1:31:12 PM UTC+5:30, Aditya Duggal wrote:
Hi Nabin,

I just tried this thing to change my labels in Item Page but I am unable to get the desired results, there is no error but the function is giving me a alert as desired but the Labels are not changing.

My code is here.

Now I have called the function to change the labels on line# 84 and the function to change the labels start from line# 298

Now the problem is that function is being called correctly and I am also able to see the correct labels in the ALERT message on line 307 and 308 but the actual labels of the field are unchanged....I know I am missing something but I am not able to find what?

I have taken cue from your gist here.




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/0f637b2d-a0b7-4b7e-a4ca-fe9740ecf11d%40googlegroups.com.

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