Current Date Form Field

  • Current Date Form Field

    Posted by Troy DeGroot on May 2, 2022 at 11:19 am

    Where are my Java gurus?

    I have a template document for a form I use all the time. The only thing I update on this form is the date. How would I automate this so the date is current every time I open the template. I could use a stamp, but that’s almost as fast as updating the existing text.

    Vince French replied 1 year, 9 months ago 3 Members · 6 Replies
  • 6 Replies
  • Vince French

    Member
    May 2, 2022 at 12:19 pm
    Points: 11,788
    Rank: UC2 Brainery Blue Belt I UC2 Brainery Blue Belt I

    I’ve found this before: –

    To get the date use the following script

    • Name a text box form field “Today”.
    • Open the Properties of that form field.
    • Under Format, choose Custom as the Category and then click Edit.
    • Enter this JavaScript and then click OK.

    var f = this.getField(“Today”);

    f.value = util.printd(“mmm/d/yyyy”, new Date());

    I think it work…..🤔

    • Troy DeGroot

      Organizer
      May 3, 2022 at 9:59 am
      Points: 20,772
      Rank: UC2 Brainery Brown Belt UC2 Brainery Advanced Brown Belt Rank

      Thanks @Vince I’ll have to try that.

      As a workaround, I created a custom tool that stamps the date in the correct location, flattens the document, and opens the Save As window, all in one button.

      • Vince French

        Member
        May 3, 2022 at 10:54 am
        Points: 11,788
        Rank: UC2 Brainery Blue Belt I UC2 Brainery Blue Belt I

        Sounds rather clever @troy-degroot !

        I tested out the code that I sent through and all you have to do is open the document then save it for the date to update.

      • Ken Bolen

        Member
        June 24, 2022 at 11:09 am
        Points: 850
        Rank: UC2 Brainery White Belt III UC2 Brainery White Belt III

        Troy,

        Do you mind sharing theat code? I am trying to find examples of JavaScript and interacting with Bluebeam.

        Thanks!

        Ken

        • Troy DeGroot

          Organizer
          June 24, 2022 at 11:17 am
          Points: 20,772
          Rank: UC2 Brainery Brown Belt UC2 Brainery Advanced Brown Belt Rank

          Turns out I didn’t save my tool after I created it. 🤣 I need to recreate it and will share it.

          • Vince French

            Member
            June 25, 2022 at 1:01 am
            Points: 11,788
            Rank: UC2 Brainery Blue Belt I UC2 Brainery Blue Belt I

            😂

Log in to reply.