How can I add form field value to the file name in save as dialog box

I do not want the form to be saved automatically, just want the form to auto populate the "file name" only.
A little background on the forms I want to use:  My company has 70 retail outlets, I'll use one of our pdf forms called an "Incident Report" as an example.  I would like for a store manager to be able to complete the form, then email the form to the main office (I already have javascript to add field values and form name to the email subject line), once the main office receives it, I want for them to be able to file the pdf electronically on our server.  We have mutliple forms that we use so I do not want any of the forms to automatically save anywhere, (at this time anyway) I just want the office personnel to be able to click "save as" (or whatever they will need to click) and the form automatically add certain field values from the pdf they have received, of which will be different each time the form is sent to the office (Date, store #, employee name etc.) in addition to the name of the form in the "File name" of the "Save As" dialog box.  The main office employees will decide into which server file the pdf should be saved.
I'm using Acrobat 8 professional, the stores and office personnel use Adobe reader.
One little note:  We currently print and file a lot of paper on a daily bases, as soon as I can get this to work, we are going green.
Me and a lot of trees in this will really apprecitate any help you can give with this!  :-)

You might want to take a look at the document "Developing Acrobat Applications Using JavaScript" (js_developer_guide.pdf) which is part of the Adobe Acrobat SDK, which can be downloaded here. Read the "Privileged versus non-privileged context" (p. 45ff.). You will find an example for "Executing privileged methods in a non-privileged context". Should be almost exactly what you are looking for.
Small Outline: For security reasons ("the user always has to know what's going on") you are not allowed to use the "Doc.saveAs"-method without the user permission (--> in a non-privileged context). In order to reach the goal of a privileged context you can use a trusted function. You do this by creating a JavaScript file (*.js) in either the Application-JavaScript-Folder (default location on Windows systems: "%ProgramFiles%\Adobe\Acrobat 10.0\Acrobat\Javascripts") or the User-JavaScript-Folder (default location on Windows systems: "%AppData%\Adobe\Acrobat\10.0\JavaScripts"). Add the following content to the new file:
myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs ) {
     app.beginPriv();
          var myTrustedRetn = app.browseForDoc( oArgs );
     app.endPriv();
     return myTrustedRetn;
myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs ) {
     app.beginPriv();
          var myTrustedRetn = doc.saveAs( oArgs );
     app.endPriv();
     return myTrustedRetn;
The developer guide actually wants you to add this content to the existing "config.js" file. I recommend creating a new file, since its easier to deploy in a network. Either way, every client/user who needs to be able to save documents this way, needs this JavaScript Code in his Application/User-JavaScript-Folder.
Within the Acrobat Document, which you want to obtain a certain file name, you can now use the trusted functions "myTrustedBrowseForDoc" and "myTrustedSaveAs" to store the file. To call the trusted functions and deliver the file name you can either you use a form field (button) or you add a new menu item. Add the following JavaScript Action to the button/menu item and change "Roller Coaster" to the name of the field which contains the value which you want to become the new file name:
var fileName = this.getField("Roller Coaster").valueAsString;
try {
     var oRetn = myTrustedBrowseForDoc({bSave: true, cFilenameInit: fileName + ".pdf"});
     try {
          myTrustedSaveAs(this, { cPath: oRetn.cPath, cFS:oRetn.cFS });
     catch(e) {
          console.println("Save not allowed, perhaps readonly.");
catch(e) {
console.println("User cancelled Save As dialog box");
Good Luck!

Similar Messages

  • How can i transfer a field value in the main report to its sub-report?

    <p><font face="Arial" size="2">How can i transfer a field value in the main report to its sub-report?</font></p><p><font face="Arial" size="2">Please eloberate with example if possible!</font></p><p><font face="Arial" size="2">Thanks...</font></p><p> </p>

    <p>You can do a couple of things - one would be to pass the information using the data linking expert.  Right click on the subreport, choose &#39;Change Subreport Links&#39; and select the field(s) you are wanting to pass to the subreport.  CRW will build parameters and a record selection formula for you in the subreport, and if that&#39;s what you want, then great.  But you can also remove the selection formula from the subreport and work with the parameter fields in the subreport however you would like.</p><p>Alternatively, you can look to passing Shared variables back and forth from the main and subreport.  this link talks about the method to do this: http://diamond.businessobjects.com/node/251</p><p> </p>

  • How can I use field value as a pdf filename in save as dialog box

    Hello,
    I want to use a submit/save button and once you press that the document is automatically named like a field in that document,
    e.g. their is a date field in PDF, When I click Save button in PDF  Then the file name in Save As window is automically entered. Like "09/08/2012.pdf"
    I'm using Adobe Acrobat X Pro.
    Thanks a lot for all your help,
    I really appreciate it.

    Hello Ebnul.nao
    I am having this same problemwith trying to work this out.
    Did you succeed in the end?
    I will really appreciate your help if you did
    Kind regards

  • Can you assign field values as the file name

    When filling fillable pdf forms I would like to assign the name of the file (automate a Save As) to field values. 

    Place a regular button on the form and write the below code in the click event of button:
    app.execMenuItem("SaveAs");
    Thanks,
    Vipin

  • How can I pass Flex Field value to the Call Wrap Up screen?

    Hello helpers,
    I am trying to get a value from the 'Flex Field' passed over to the 'Call Wrap Up' screen by using Form Personalization.
    Oracle was configured by a subcontractor and therefore I do not know what the exact name of the textfield is in the Flex Field however the label is 'Method of Contact'. When i set 'Show Custom Events' to 'On', I get the response: 'CSXXXRC.INCIDENT_TRACKING.STATUS_CODE:WHEN-NEW-ITEM-INSTANCE' When i enter a value in the Method of Contact field in the Flex Field.
    Can anyone help?
    I am a complete Newbie to Oracle.... I only know a bit about Oracle Form Personalization.
    Any help would be much appreciated,
    S

    Seems like you're talking about a from from the eBusiness-suite. There are special rules for that, ask your question in the eBusiness-suite-forum OA Framework

  • Folder level script? How can I use field value as a pdf filename in save as dialog box

    I read somewhere that if you use a folder level script, you can do things like save a pdf with a specific filename - possibly based on a field name.
    How would one set up a folder level script?
    How do you execute a script from the PDF?
    What code would you use to change the PDF name to the contents of the fFieldName text field?
    Or, is this really just impossible to do?

    The article is interesting.  It suggests you place code like this:
    // Page Replacement Function
    var ReplaceLastPage = app.trustedFunction( function(cPath) {
    app.beginPriv();
    this.replacePages(this.numPages-1, cPath); app.endPriv();
    In the trusted folder.  What is the path of the trusted function(s) that get automatically loaded into Acrobat?
    I assume in the example above, function(cPath) is a function inside of the PDF...

  • How can I add a new vaiable to the file loaded by Property Loader without changing my script

    I have an input file to my script that I load via Property Loader. The number of parameters in the input file may change from test to test.. Is it possible in some way to add a new parameter without changing the sequence file?
    Is there for example a way to make the Property loader read parameters until end of file, and put the parameter into a temporary variable in my script?
    Hope there is a way to resolve this.
    Cheers
    Claus Christophersen

    Claus,
    The solution you have is a valid one.
    Basically you have a variable (global or local) and you import the expected parameter to this variable before you pass it to the hardware.
    You use that variable as the input parameter you pass to your hardware of course.
    You have to modify your source file depending on the test type you want to execute every time you want to change the test type though.
    Another solution would be to use Data Markers in your file to separate the variable values corresponding to each test type.
    Check the example I am attaching.
    At the beginning I prompt the user for the Test Type (Type I or Type II).
    Based on the type, I import the corresponding variables from the source file using Data Markers.
    If you have questions let me know.
    Attachments:
    SourceFile.zip ‏8 KB

  • How can I add a blank value in a standard drop down list

    Hello,
    I have a requirement to add a blank value into the standard drop down list of for i.e. the search criteria
    "created on" -> (values are: yesterday/today/last week etc).
    The problem is, that this field has always the default value "yesterday" but our customer wants to have a blank field as default.
    Can anybody provide me steps how can I add this blank value ?
    Many thanks in advance

    Hi Bernard,
    thanks for your reply.
    Its for quotation.
    Could you give me still some further detail steps, please ?
    Many thanks
    Andreas

  • How can we add additional fields to the BP Search RESULT screen?

    Dear Experts,
    How can we add additional fields to the BP Search RESULT screen so that the BP's being displayed in a search result show maintained values for the particular column/field?
    Thanks!!!

    Hi Laxman,
                           I got same requirement for ibase hierarchy.I want to add new fields in Ibase hierarchy AB.Do you have any idea regarding this.My requirement is that ,i want to dispaly a fields as a check box which display that this component is in under warranty or not by checking the box.Plz tell ,how can i add a new field in tree type context node.I add a new fields using AET ,but that is not available in that AB.
    Thanks
    Vishwas Sahu
    Edited by: vishwas sahu on Nov 17, 2009 1:51 PM
    Edited by: vishwas sahu on Nov 18, 2009 5:22 AM

  • How can I add a field to a Repeating Frame in the body of a 9i Report

    How can I add a field to a Repeating Frame in the body of an Oracle 9i Report whose source is in a higher group?
    I want to change an Oracle 9i report. The report has no header or trailer but only a body. The body has the parent frame fields & a repeating frame with four fields, A, B, C & D. They all seem to be in one group. I want to add another field E to the repeating frame whose source is from the 'header'.
    I added the field & created a boiler plate & then added the new field, E to the original group A, B, C & D. In the Property Inspector for the field, I pointed the source to the source column in the main query. However, when I run the report, I receive the error "Invalid body size". Some notes on Metalink indicate that this could be due to margins being out of the printable area.
    Moreover, after making the changes & after having unsuccessfully run the report, when I try to open the Page Layout for the report, I get no details.
    Thanks,

    Hi,
    i also got same query can u pls tell me elaborately, if u can can u pls send some code.
    Thanks & Regards
    Jagadeeshwar.B

  • IF_IXML : How can i add encoding with value UTF-8 to the document object??

    Hi
    i want to create a xml file with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    i did this with the if_ixml interface and rendered the content in a file 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml
    <?xml version="1.0"?>
    <OpenSearchDescription xmlns="http://...."> 
    </OpenSearchDescription>
    BUT the document attribut(?) encoding="UTF-8"?> is missing!
    How can i add encoding with value UTF-8 to the document object?? it should look like:
    <?xml version="1.0" encoding="UTF-8"?>
    *here is my coding.
    TYPE-POOLS: ixml.
    CLASS cl_ixml DEFINITION LOAD.
    DATA: lo_ixml           TYPE REF TO if_ixml,
          lo_streamfactory  TYPE REF TO if_ixml_stream_factory,
          lo_document       TYPE REF TO if_ixml_document,
          lo_parent         TYPE REF TO if_ixml_element,
          lo_ostream        TYPE REF TO if_ixml_ostream,
          lo_renderer       TYPE REF TO if_ixml_renderer,
         lv_rc           TYPE i.
    lo_ixml = cl_ixml=>create( ).
    lo_streamfactory = lo_ixml->create_stream_factory( ).
    lo_document = lo_ixml->create_document( ).
    lo_parent = lo_document->create_simple_element( name   = 'OpenSearchDescription'  "root node
                                                    parent = lo_document ).
    lo_parent->set_attribute_ns( name   =  'xmlns'
                                 value  = 'http://....' ).
    *rausrendern in file
    lo_ostream = lo_streamfactory->create_ostream_uri( system_id = 'D:\usr\sap\IFD\DVEBMGS01\log\TEST_out.xml' ).
    lo_renderer = lo_ixml->create_renderer( ostream  = lo_ostream
                                            document = lo_document ).
    lv_rc = lo_renderer->render( ).
    Thanks for help
    Britta

    Use the following code:
    set an document encoding
      l_encoding = l_ixml->create_encoding( character_set = 'UTF-8'
                                            byte_order = if_ixml_encoding=>co_none ).
      l_success  = l_ostream->set_encoding( encoding = l_encoding ).
    create a xml renderer
      l_renderer = l_ixml->create_renderer( document = l_doc ostream  = l_ostream ).

  • The recent upgrade for i-tunes prevents me from adding and using the Field, "Show". How can I add this field in i-tunes?

    The recent upgrade for i-tunes prevents me from adding and using the Field, "Show". How can I add this field in i-tunes?

    Hold down shift as you right-click > Get Info to get the old style dialog box.
    tt2

  • How can i add Custom fields into the

    Dear Experts
    We have Ecc6.0 system,
    How can i add Custom fields into the Infotype Screen(PA30),i heard that we do it by PM01 Tcode.
    But in PM01 i am unable to find the enhance infotype tab.
    How can i do it ....pls help.....
    Regards
    Sajid

    Hi,
    Do it thru the third tab : Single Screen.
    There write down the infotype number (e.g. 0022) and say generate objects.
    Regards,
    Dilek

  • How can i add form of my own to "SAPM07DR"

    i been asked to add form develop by me to the standart program "SAPM07DR" .
    this task came from the need of the implementation
    of the "material management" , assign forms and program.
    now i get the output "ZWE4"  ,
    and i want to assign form of my own  ,
    i tried to add smart form but i get message
    "Errors occurred while processing output"
    so I want to try layout  with  standard program "SAPM07DR" .
    how can i add form of my own to this program

    First, you must copy this program to your own program with "ZSAPM07DR" then copy the include program where the routine pass through the program
    example: entry_we03 -> from include M07DRENT and M07DRAUS
             change this include to ZM07DRENT and ZM07DRAUS
    The next step is binding your form in the program.
    what forms do you use ? Sapscript or Smartforms ?
    in this Program already used Sapscript. You can See there is Open_Form Function in that Program.
    I suggest you to Bind Smartforms.
    IF you use smartforms, Remark All Statement from
    "PERFORM open_form_sammel." to "PERFORM close_form." before endform
    that perform including in M07DRAUS -> FORM lesen_wes USING objky lgortsplit.
    after that put this program to replace the remark :
    data : FMNAME type RS38L_FNAM.
    DATA: ls_control_param      TYPE ssfctrlop.
    set preview parameters
          MOVE 'X' TO ls_control_param-no_dialog.
          MOVE 'X' TO ls_control_param-preview.
          MOVE 'PRINTER'  TO ls_control_param-device.
    *break-point.
    *****Print SmartForms
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
              FORMNAME           = TNAPR-SFORM
            IMPORTING
              FM_NAME            = FMNAME
            EXCEPTIONS
              NO_FORM            = 1
              NO_FUNCTION_MODULE = 2
              OTHERS             = 3.
         CALL FUNCTION FMNAME
         EXPORTING
             control_parameters   = ls_control_param
         TABLES
             traptab           = traptab
         EXCEPTIONS
             formatting_error = 1
             internal_error   = 2
             send_error       = 3.
         if sy-subrc NE 0.
    *******message 'Error' type 'S'.
         endif.
    *******End Smartforms
    Hope This Help...

  • How can i add a navigation rule at the runtime of JSF?

    Hello,
    how can i add a navigation rule at the runtime of JSF. Maybe i should use the method "addNavigationRule()" in class "FacesConfig", but i do not know, how can i obtain the instance of class "FacesConfig". Can anybody help me?
    Thank you very much!!!

    Just curious: Why whould you want to add navigation Rules at run time. I believe the navigation rules should be set to begin with - "by s/w Architect Design".
    Else you can always use Redirect / Forward.

Maybe you are looking for