1 Reply Latest reply on May 3, 2016 11:06 AM by radzmar

    Autonumber field will not stop recalculating

    dperani70

      I have an adobe form (Purchase Requisition) that we are trying to use a field (SetReqNo) to calculate a number (Business Account number + Date + Time) to autonumber the form.  Problem is the form renumbers every time it reopens.  Since it is a calculated field, making it read only will not help.

       

      So I tried a work around of having a checkbox (LockPRNum) that gets checked when the form is submitted by email or printed and the calculated field (SetReqNo) checks this checkbox and will only calculate if the checkbox is unchecked.  Seems great except it is now changing the calculated field (SetReqNo) to the value of 1!

       

      Not sure how or why but thought I could post this form here and see if anyone can help.  See link to form below.

       

      Link to Form: Dropbox - 0008V07P4.pdf 

        • 1. Re: Autonumber field will not stop recalculating
          radzmar Adobe Community Professional & MVP

          Well, the script you use to calculate the number is quite complex, but in general only have to wrap the entrie script it into an if expression.

           

          if (this.isNull) {
              // place your calculation script here …
          }
          

           

          Btw: Your expression

          this.value =  …
          

          is wrong and should be

          this.rawValue = …
          

          instead.

           

          Note: When you want to Reader-enable the form with Acrobat once it got finished, you have to clear the field manually otherwise the field will always hold the calculated value before it was Reader-enabled. To do this, open the the JavaScript console (Ctrl + J) and execute this code line:

           

          this.xfa.form.Form0008.PgContent.SetReqNo.rawValue = null;