Caculated files

Forums General discussion Caculated files

Viewing 8 reply threads
  • Author
    Posts
    • #29056
      Silvestre Kassoka
      Participant

      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

    • #29060
      Alexander Bautz
      Keymaster

      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

    • #29071
      Silvestre Kassoka
      Participant

      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.

    • #29073
      Alexander Bautz
      Keymaster

      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

    • #29075
      Silvestre Kassoka
      Participant

      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:
    • #29081
      Alexander Bautz
      Keymaster

      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

    • #29084
      Silvestre Kassoka
      Participant

      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:
    • #29087
      Alexander Bautz
      Keymaster

      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

    • #29096
      Silvestre Kassoka
      Participant

      Hi Alex,

      Sorry i missed that bit.

      As always thanks a lot , its working exactly as i intended!!!

      Regards

Viewing 8 reply threads
  • You must be logged in to reply to this topic.