The value of the field is not a valid number.
Hello,
when I use the following script in MS Edge, Google Chrome or Firefox
//Calculate Consulting
var total = 0;
var rows = fd.relatedItems(4).data('ctx').ListData.Row;
rows.forEach(function(item) {
total += parseFloat(item['Kosten.'])
total_overall += parseFloat(item['Kosten.'])
});
fd.field('Kosten_x0020_Beratungsaufwand_x0').value(Number(total.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"}));
an error occured in the field Kosten_x0020_Beratungsaufwand_x0 when I save
The value of the field is not a valid number.
What is wrong?
Best wishes
Tom
when I use the following script in MS Edge, Google Chrome or Firefox
//Calculate Consulting
var total = 0;
var rows = fd.relatedItems(4).data('ctx').ListData.Row;
rows.forEach(function(item) {
total += parseFloat(item['Kosten.'])
total_overall += parseFloat(item['Kosten.'])
});
fd.field('Kosten_x0020_Beratungsaufwand_x0').value(Number(total.toFixed(2)).toLocaleString("de-DE", {style: "currency", currency: "EUR"}));
an error occured in the field Kosten_x0020_Beratungsaufwand_x0 when I save
The value of the field is not a valid number.
What is wrong?
Best wishes
Tom
Hello Tom,
Thank you for the information!
The currency field type accepts only numbers. The currency sign displayed in a list view and on the display form only.
Thus, please remove the toLocaleString function from the code:
Thank you for the information!
The currency field type accepts only numbers. The currency sign displayed in a list view and on the display form only.
Thus, please remove the toLocaleString function from the code:
Code: Select all
//Calculate Consulting
var total = 0;
var rows = fd.relatedItems(4).data('ctx').ListData.Row;
rows.forEach(function(item) {
total += parseFloat(item['Kosten.'])
total_overall += parseFloat(item['Kosten.'])
});
fd.field('Kosten_x0020_Beratungsaufwand_x0').value(Number(total.toFixed(2)));
-
- Information
-
Who is online
Users browsing this forum: No registered users and 16 guests