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 replied 2 years, 5 months ago 3 Members · 6 Replies
  • 6 Replies
  • Vince

    Member
    May 2, 2022 at 12:19 pm
    Points: 13,595
    Rank: UC2 Brainery Blue Belt III UC2 Brainery Blue Belt III

    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: 23,563
      Rank: UC2 Brainery Brown Belt III UC2 Brainery Brown Belt III

      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

        Member
        May 3, 2022 at 10:54 am
        Points: 13,595
        Rank: UC2 Brainery Blue Belt III UC2 Brainery Blue Belt III

        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: 23,563
          Rank: UC2 Brainery Brown Belt III UC2 Brainery Brown Belt III

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

          • Vince

            Member
            June 25, 2022 at 1:01 am
            Points: 13,595
            Rank: UC2 Brainery Blue Belt III UC2 Brainery Blue Belt III

            😂

Log in to reply.