4 Replies Latest reply on Oct 30, 2014 2:41 AM by suspct

    Dynamic Stamp Help

    suspct

      Hi All,

           I'm a bit of a Newbie to dynamic stamps and need a little help with some code.

      I had an issue with stamp prompting before i could place it, even then after entering a valid response it would still not let me place a stamp. I added the highlighted code now its waiting until i place the stamp but the response isn't showing on the stamp.

       

      var cResponse = app.response({

      cQuestion: "Enter the PO Number.",

      cTitle: "Purchase Order Number",

      cLabel: "PO:" });

       

      if(event.source.forReal &&

         (event.source.stampName == "#s7c7LeqDrxgy84o8Lg6-wD2"))

      {

      if (cResponse == null)

      {event.value = "*NVALID*";}

      else

      event.value = cResponse;

      }

       

      Thanks heaps

        • 1. Re: Dynamic Stamp Help
          try67 MVP & Adobe Community Professional

          Did you adjust the stampName so that it matches yours, or did you just copy it from elsewhere?

          Move the app.response call to within the code block after the if-statement in red.

          • 2. Re: Dynamic Stamp Help
            suspct Level 1

            Cheers for the response

            I changed the file name to the stamp name, i also tried the below code as well..

             

            if(event.source.forReal &&

               (event.source.stampName == "#s7c7LeqDrxgy84o8Lg6-wD2"))

            {

            var cResponse = app.response({

            cQuestion: "Enter the PO Number.",

            cTitle: "Purchase Order Number",

            cLabel: "PO:" });

            if (cResponse == null)

            {event.value = "*NVALID*";}

            else

            event.value = cResponse;

            }


            I get no prompt at all with the above code.

            • 3. Re: Dynamic Stamp Help
              try67 MVP & Adobe Community Professional

              The file name has nothing to do with the stamp name. The latter is an internal property of the stamp.

              To get it you can do this: Apply the stamp and then select it with the mouse and run the following code in the JS Console:

              this.selectedAnnots[0].AP

              It will print out the stampName property that you should use in your script.

              • 4. Re: Dynamic Stamp Help
                suspct Level 1

                Thanks heaps for that works great