Calculated field displaying wrong information in email message - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Calculated field displaying wrong information in email message

Last post 07-21-2011 03:55 PM by Ted Fitch. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 07-21-2011 08:43 AM

    • Poldy
    • Not Ranked
    • Joined on 09-16-2009
    • Posts 7

    Calculated field displaying wrong information in email message

    In my InfoPath 2007 form, the default value for one of my textboxes displays the result of a calculation (the sum of 4 fields substracted from the total of another field). In the form, everything works as designed. At the end of the calculation, the result shows what a person owes with respect to certain fees. Since this is a negative number, we display it in parenthesis.

    I've attached a SharePoint Designer custom workflow to the form library. I've included this calculated field in the body of the email that is sent to the individual informing this person of the amount owed. This is where the trouble occurs. For example, a typical calculation results in the form amount owed field displaying (500)--i.e., the individual owes $500. However, in the email message, this same field displays as -1500. I found a way to get rid of the minus sign in front of the number; however, I'm still confused as to why the field is displaying a completely different number.

    Here's how the the calculation works. I have a totalCost field which displays the sum of four fields: fieldA+fieldB+fieldC+fieldD=totalCost. I then use the totalCost field in the above-mentioned calculated field:

    fieldE+fieldF+fieldG+fieldH-totalCost=[this number is displayed as the calculated field's default value]. As I said, the calculation works as designed in the form. However, things go awry in the workflow email message.

    Any thoughts?

    Thanks.

  • 07-21-2011 03:22 PM In reply to

    Re: Calculated field displaying wrong information in email message

    Hi Poldy,

    What is the datatype of the field in InfoPath?  My guess would be SharePoint isn't handling that datatype correctly from InfoPath.

    Ted

  • 07-21-2011 03:43 PM In reply to

    • Poldy
    • Not Ranked
    • Joined on 09-16-2009
    • Posts 7

    Re: Calculated field displaying wrong information in email message

    Hi, Ted:

    It's a Decimal (double) field.

     Thanks.

  • 07-21-2011 03:55 PM In reply to

    Re: Calculated field displaying wrong information in email message

    Take a look at the value that is actually saved in your XML for this calculated field and then see what it looks like in SharePoint.  I am guessing that in SharePoint it may be different than what is in InfoPath.  If that is the case you may need to round the number in InfoPath or something to get rid of the decimal points.  I think the decimals are confusing SharePoint.

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.