Home › Forums › General discussion › Caculated files
- This topic has 8 replies, 2 voices, and was last updated 4 years, 9 months ago by Silvestre Kassoka.
-
AuthorPosts
-
-
March 10, 2020 at 14:48 #29056
Hi Alex,
I have a calculated field which is calculated using a custom JS on the new form. However when i try to lookup this value in Email notifications the value is coming out as zero.What could be the problem ? Can calculated fields not be looked up?
If so , how can i lookup this field.
Regards
-
March 10, 2020 at 16:42 #29060
Not sure what you mean – are you calculating using the “Basic calculations” in the rule and writing the value to a single line of text field, or is it actually a calculated field?
Alexander
-
March 11, 2020 at 09:47 #29071
Alex, Sorry i did not articulate myself well.What i actually I mean is to lookup value
derived through Basic calculations that writes to a single line.I have a form with which has a rule that does a Basic calculation of a total value and what i want is to lookup this value in e-mail notifications. I have tried it but apparently the value is coming up as 0.
Hence the questions, is it not possible to lookup values made through basic calculations? If so how can i lookup this values in e-mail notifications.
-
March 11, 2020 at 13:30 #29073
If the calculated value is written to the single line of text before the email is triggered it should work. What is the calculation triggering on and when is the email sent?
Alexander
-
March 11, 2020 at 14:59 #29075
Hi Alex,
I think that’s the problem the values on gets displayed on the form however when i save the form and go to the list item the i see no value corresponding to that column.I have attached the file that shows the JS code doing the calculations.
Attachments:
-
March 11, 2020 at 16:17 #29081
This code can only be used in NewForm or EditForm, and to let the form actually save your calculated value you must write it to the actual input in the form. This means you must change this line:
jQuery("#dffs_h4hm .ms-formbody").html(total);
to this:
jQuery("#dffs_h4hm input").val(total).hide().after(val);
This will write the value in the input (text field) to let SP save it when the form is saved and then hide the input so users cannot edit it, and finally add the value again to make it visible to the user.
Alexander
-
March 11, 2020 at 17:59 #29084
Hi Alex,
Thanks the code actually work to insert the total value to the single line of text for the subsequent lookup the forms.However the value is no longer being displayed on the form. Actually the system throw an error , see annex.
Attachments:
-
March 11, 2020 at 19:11 #29087
Sorry, it should be “total” and not “val” – just change it in the code like this:
jQuery("#dffs_h4hm input").val(total).hide().after(total);
Alexander
-
March 12, 2020 at 10:54 #29096
Hi Alex,
Sorry i missed that bit.
As always thanks a lot , its working exactly as i intended!!!
Regards
-
-
AuthorPosts
- You must be logged in to reply to this topic.