Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Change format of a date field to use as part of a file name.

$
0
0

Good afternoon!

 

I am using Livecycle ES3 and Adobe Professional XI

 

I have a livecycle form for employee evaluations.

 

I am saving a file based on field names.  My problem is when I use a date field as part of my file name.  I have the scripts working for the trusted function and for the button field on the form.  They are listed below.

 

Folder level script--

 

mySaveAs = app.trustPropagatorFunction(function(doc, path)
{
     app.beginPriv();
         doc.saveAs(path);
     app.endPriv();
});

myTrustedSpecialTaskFunc = app.trustedFunction(function(doc, file_path)
{
     // Privileged and/or non-privileged code above
     app.beginPriv();
          mySaveAs(doc, file_path);
     app.endPriv();
});

 

Button script

 

 

myTrustedSpecialTaskFunc(

this, "/c/myfiles/" + ReviewPeriodTo.rawValue+ "-" + Div.rawValue + "-" + EVALTTYPE.rawValue + "-" + LASTNAME.rawValue + "-" + FIRSTNAME.rawValue +

".pdf");

 

 

My problem is the ReviewPeriodTo.rawValue.  When I enter the data into the form and don't enter a value for ReviewPeriodTo field, the file is saved with the values from the other fields, and a null is inserted where the date field would go.

 

When I type in a value such as 2014-03-15 in the ReviewPeriodTo field along with values in the other fields, it works.

 

 

When I try to put a value in such as 3/15/2014 in the ReviewPeriodTo field, I receive the following error.

 

RaiseError: The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder.

Doc.saveAs:16:XFA:form1[0]:Page1[0]:#subform[0]:Button3[0]:mouseUp

===> The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder.

 

My problem is, this is part of a much larger process where I am importing the information from a make table query from MS Access that is exported to Excel.  If I could just format the field data automatically to the yyyy-mm-dd forma from that t, that would work, but I do not know how to do coding in MS Access. 

 

How can I format the data that is input into the form to be the yyyy-mm-dd format?

 

I have tried changing the display and data format through livecycle patterns for the field, but that is not working.

 

Any assistance would be greatly appreciated!

 

Thank you


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>