Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
PDF SaveAS Filename From Data With JS Customization

I seached and found a script that works for saving as from data in specific fields and managed to customize it to a degree to work for my application. It saves to the current folder when launched from a action button and pulls the info from the fields as it should without issue.

Here's the script for reference:

/* saveAS */

    // determine the directory path for the current document 
    var directory = "";
this.path.substring(0, this.path.lastIndexOf('/') +1); 
    if (typeof(mySaveAs) == "function") { 
      mySaveAs(this, directory, "W.O." + " " + this.getField("W.O. #").value + " " + this.getField("Work Site Address").value + " " + this.getField("Date").value + ".pdf"); 
    } else { 
      app.alert("Missing Save Function. Please contact forms administrator "); 
    } 

What I need help with is changing the date format it uses in the file name. For example; the date in the date field is fomated as mmmm d, yyyy (displays date as October 23, 2021) which is how I would like it to display there. When running the script it should change and use the date as mmm d, yyyy (display date as Oct 23, 2021 in the filename). I am pretty sure this can be done as I have used something similar to this for other code before and it worked, but the code syntax was a bit different.

Another thing I would like if possible would be to have it change the formatting for the filename specifically how it puts the jobsite address field into the file name. We usually put the full address in that field in this format "street_# street_name street_type. city, province" When using the script to save as the file, I want it to only use it like this: "steet_# street_name street_type." basically it should ignore everything in the address field after the period when creating the filename. Is it possible to write something like this?

The final filename should look like this: "W.O. 7655 123 First St. Oct 23, 2021.pdf" when saved as with the above formatting changes applied.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda