2 Replies Latest reply on Apr 9, 2014 10:29 PM by symbister

    Auto-Enter Calculation not working...?



      Auto-Enter Calculation not working...?


           Using FMPA11

           I have a 'Donation Acknowledgement' field that I'm trying to default to the contact's first and last name, but can be overridden, for example if the Donor wishes to be anonymous, or donation is in a company name.

           So, I defined an auto-enter calculation:

           contacts::donationacknowledgement = contacts::full_name, (checked Do Not replace existing value...) which is in turn a Calculation field, result text, unstored, = contacts::firstname & " " & contacts::lastname

           starting a new record, the first name auto-populates into the Donation Acknowledgement field, but not the last, although the field contacts::full_name populates correctly

           is it possible that the first name populates, then because I've checked the Do Not Replace tag, having the first name prevents the last name from populating?

           further thought - DonAck only populates with the first entered of the two names.

           any ideas?

        • 1. Re: Auto-Enter Calculation not working...?

               I believe that you are correct as to why you only get the first name. You may want to use set field with script triggers on the first and last name fields to update this field instead of an auto-enter calculation as I can't quite come up with a way for it to do what you want here.

               Another approach that does not use any scripting is to do it all with calculation fields. Define a text field, AckMessage that you leave blank if you want your acknowledgement field to be just the name, but where you enter other text if you want that to appear instead. Then your DonAck field becomes:

               IF ( IsEmpty (AckMessage) ; firstname & " " & lastname ; AckMessage )

          • 2. Re: Auto-Enter Calculation not working...?

                 OK, thanks Phil....

                 realised I was over-thinking this, new records will necessarily have nothing in the DonAck field, therefore auto-entering doesn't need to have the 'Do Not replace' tag checked .... and the user can just overwrite if need be ...

                 and now (after a backup, naturally :) I'm going to do a replace field contents, using a calc to ensure that existing records have first and last name in the DonAck, unless there is already other - different - text in there ...