Acrobat Calculated Date JavaScript

Hi, I was wondering if anyone may assist me with this.
I have a form that people complete for travel. Certain things have to be submitted not later than specific days before their travel.
Beginning of form has travel date Q.1: mm/dd/yy
Based on the travel date, there are a few deadlines to complete a few items.
For example-
Q2. submit form 0900 no later than [mm/dd/yy] --> here it spits out a date that is travel date info submitted above minus, say, 60 days.
So on and so forth. I would be able to apply the rule to several questions, but would appreciate if someone may assist with the proper script to insert for this?
Thanks a bunch!!

Above ^ is the form with notes to capture my goal visually..
So I went through the code and found the minor issue - I think... I converted the Q1-->TRAVEL_Date & Q2--> SUBMIT_NO_LATER (to reflect fields in my form).
I think the issue I run into with the code provided is the field Travel_Date (originally Q1), it is blank until the user fills out the Travel_Date field. Once they complete it, only then (based on the information the user enters in the first field), does the second field (Submit_No_Later) automatically has a date generated.
The items in bold are "unknown" until the user completes the info. Is there a way to make that information populated based off of what is entered in Q1/Travel_Date, that will in effect translate to the next field --> SUBMIT_NO_LATER?
// TRAVEL_DATE date of "04/01/2015"
var TRAVEL_DATE = "04/01/15";
// TRAVEL_DATE convert to date object;
var oTRAVEL_DATE = util.scand("mm/dd/yy", TRAVEL_DATE);
if(oTRAVEL_DATE == null) app.alert("Error converting " + TRAVEL_DATE + " using format mm/dd/yy", 1, 0);
// display the date and time value for TRAVEL_DATE;
app.alert("TRAVEL_DATE is " + util.printd("mm/dd/yy HH:MM", oTRAVEL_DATE), 3, 0);
// subtract 60 days
if(oDate != null) {
// compute the SUBMIT_NO_LATER date;
var oSUBMIT_NO_LATER = new Date(oTRAVEL_DATE.getFullYear(), oTRAVEL_DATE.getMonth(), oTRAVEL_DATE.getDate() - 60, 9, 0, 0, 0);
// display the computed SUBMIT_NO_LATER date;
app.alert("SUBMIT_NO_LATER is " + util.printd("mm/dd/yy h:MMtt", oSUBMIT_NO_LATER));
} else {
app.alert("SUBMIT_NO_LATER could not be computed.", 1, 0);

Similar Messages

  • POWL refresh for calculated dates

    Hi,
        When I use my POWL with calculated dates configured in POWL_QUERY.When I refresh the same in POWL Worklist after the next day this is not getting refer it is refreshing dates only when I click the calculated dates tab in POWL_QUERY.
    Regards,
    Amit
    Moderator message: not a question, relation to ABAP development unclear.
    Edited by: Thomas Zloch on Jan 17, 2011 4:00 PM

    can you check here
    POWL is based on personalization framework where every user has its own
    set of queiries and types, which are assigned using TX POWL_QUERYR or
    POWL_TYPER which is role based. Similarlaly POWL_QUERYU and POWL_TYPEU
    for user based.
    If you want to delete a query from all users, please delete a entry from
    POWL_TYPER or POWL_QUERYR.
    More information on POWL can be get from
    http://wiki.sdn.sap.com/wiki/display/WDABAP/POWL
    http://help.sap.com/saphelp_erp60/helpdata/EN/42/d6652b755c1630e10000000
    a1553f7/frameset.htm
    Once you delete the entry, please run the report POWL_d01.Please check
    the details of report before running it.

  • Sum calculated data results from three queries in another query

    Hello,
      I would like to read calculated data from three different queries and sum them in another query.  Is it possible to do it, please?

    Hi there,
    We have done this in Excel with a debtors report. I have five queries, each on a different sheet in a workbook. I have their total line appearing at the top of the results area.
    Then I have an Excel worksheet with Excel formulas to bring through the totals on the other reports.
    i.e.   +Sheet1!C30      + Sheet2!C35     + Sheet3!D40    = Result
    Hope this helps,
    Regards
    Gill

  • Launch acrobat reader from javascript

    Hi Team,
    Greetings!
    Is it possible to launch Acrobat Reader from javascript?
    Thank you.

    hi, you can try to launch the pdf file in your server in other navigator window with Applet.getAppletContext.showDocument,
    if the client have acrobat, the pdf file open in navigator window
    take a look my linkOnApplet sample, but change myUrl for a url with a pdf file, like's this "http://mysite/file.pdf"
    i hope it help you.
    sorry but my site is in spanish.
    http://www.sunflowermachine.com/recusos/java/linkOnApplet.html

  • Fee calculation if fee calculation data change after start of academic year

    Hi,
    If I change "Fee calculation data" on student file (piqstm) after start of academic year, fee calculation doesn't use new data even I enter a fee calculation date later than new fee calculation data valid date. If I adjust validity date of "fee calculation data" at the beginning of start date of academic year It works. But I couldn't manage changes on fee calculation data after "start date of academic year".
    Is it possible to calculate fees with new "fee calculation data" if the data changes after start of academic year?
    Thanks

    Hi Joachim
    We have not yet implemented the BAdI, we are using the standard to do the fee calculation. I guess we are gonna have to post a OSS message, cause as soon as I calculate the fee for a student and I run again the fee calculation for the same student without any changes at all, the system creates 2 new documents. I had this effect in the past but only as if you stated I changed something, like a condition or something but now is without any changes that this happens.
    About the BAdI, the problem is that in our college they have more than 70 SC per campus (and the school has more than 12 campuses). The Campus Management team decided that they were going to use only 70 central SC instead of (12 x 70). By doing that we have to use a new derivation system cause the SC is attached a central school. But the reports have to be per campus. So we have plan to derivate the company code and the business area using some registration data (instead of getting it from the SC links). The same will be happening to the cost centers and profit centers.
    Thank you Joachim
    Sergio Artinano

  • Benefit calculation date

    I need to change the benefit calculation date from first day of pay period to last day of pay period.  Where is this in the IMG?  I have searched several areas, but cannot seem to find it.
    Thanks.

    I found the solution myself....the benefit start date is controlled in the payroll schema.  Function P0169 calls the health plan, parameter 1 sets the date control.

  • Livecycle ES3/Acrobat XI Pro Javascript folder

    Is this the most current information concerning where app level an user level scripts reside for Adobe Acrobat XI?
    http://helpx.adobe.com/acrobat/kb/user-javascript-changes-10-1.html
    I recently upgraded to Adobe Acrobat XI Pro & Livecycle ES 3 from X and ES2 respectively. Now Livecycle can't find the javascript file I saved at location:
    C:\Users\JoeUser\AppData\Roaming\Adobe\Acrobat\Privileged\10.0\JavaScripts
    I haven't been able to track down a document for AAXI similar to the document issued above about AA10.1 changes.Thanks

    Move your javascript files, trust functions or whatever you need to:
    C:\Users\JoeUser\AppData\Roaming\Adobe\Acrobat\Privileged\11.0\JavaScripts
    Most likely you will have to create a new folder after "Privleged" titled "11.0"
    Then create a folder after "11.0" titled "JavaScripts"
    Move your .js files into the newly created JavaScripts folder

  • Updated Acrobat and now Javascript calculations not working in new forms.

    I had created forms for my work that allowed me to calculate back dates from a given date to instruct the form users when components of a project were due. Below is the script I used- I am NOT a programmer and this was taken from another forum. It has worked successfully for 2 years in both Acrobat 9 & 10 and in various forms I have made.
    var strStart = this.getField("0VendorArtApproved-2wk").value;
    if(strStart.length)
      var dateStart = util.scand("mmm d, yyyy",strStart);
      var oneDay = 24 * 60 * 60 * 1000;
      var dueMillis = dateStart.getTime() - 21 * oneDay;
      var dueDate = new Date(dueMillis);
      event.value = util.printd("mmm d, yyyy",dueDate);
    else
      event.value = "NA";
    "0VendorArtApproved-2wk" is the field the previous date was taken from- this and the amount of days "- 21" changes from field to field. This form has 3 levels that it calulates dates from- which starts with a single initial date entered into a text box by the user. This allowed the user to see when different elements of a project were due. Sorry if this seems basic to all the Javascript masters but I am really very clueless on prgramming speak and only know what I have read from forums.
    The last version of the form that worked successfully was in Oct 13', I went to create a new form and copied these formula boxes to a new form and now half of them do no work.
    I have rechecked my formulas and formatting and cannot find and issue. They are exactly the same. One works and one does not. The only thing I can see different from the 2 forms is that I am certain there were 1 or 2 updates to the Acrobat software itself that could possibly have caused an issue.
    So I have 2 documents- 1 created in October 13' that works and one created today Jan 14' that does not work. They have the same formulas.
    Anyone aware of changes to Acrobat or errors in my formula that could have caused this? I am in version 10.1.9

    Applied this fix. There was an error in the NEW document. I redid the formulas in the NEW document and that did not work. Still had the same problem. 
    SO I went back and redid the formulas in the fields in the OLD document to the revision I needed and that worked. All I was trying to do was tweak the number of days between one element and the next in this area and there were a bunch of other revisions to the form so I figured it was easier to start fresh.  I will just make all the revisions to the OLD document- which will be a lot of work, but at least my formulas are working. Not an ideal fix but something must have been glitchy in the new document and I now have a workable form.
    I believe some kind of odd interaction happened when I copy and pasted the fields from document to another.
    Thank you so much for your help! I am days away from maternity leave so I had to get this figured out fast!

  • Acrobat Forms with Javascript

    I have a form that I would like to have required fields before saving or print. I am really new to javascript coding and know nothing about syntax. I do have some experience with basic html, but this form will not be used online. It will get emailed, filled out, and returned.
    Is there a way to prevent a user from skipping over a required field and is there a way to prevent saving/printing until all fields are completed?
    Thanks in advance.

    You can't prevent someone from saving or printing a file. But you can use a
    script to make sure (well, almost sure...) that if they try to do that when
    the file is not correctly filled, the result will be a blank file. For that
    you can use this script, created by me:
    http://try67.blogspot.com/2011/12/acrobat-validate-fields-before-printing.html
    It's also possible to prevent someone from leaving a field unless they've
    entered some data into it (again, using a script), but that's usually not a
    good idea, as it would prevent them from tabbing through the document and
    could be very annoying.

  • Stop a calculated date from updating each time the form opens

    I have a calculated "read only" Date field, that populates the current date. how do I stop this from re-calculating the date once it is submitted?

    Hi Niall,
    Is there a way I can change this script (below) to populate the date field only if the form is "dirty", so it will automatically update once something is changed on the form. I just dont know what to put in the Javascript to make it update the date. I only know how to do it automatically in Form Calc
    Sample:
    var 
    MyDoc = event.target;MyDoc.dirty
    = true;app.exec("???");

  • Calculations with JavaScript

    I am really new to this. I have used the tutorial with
    Dreamweaver to create a table based page. It is a registration form
    that has fields in the table that will need to be calculated. (# of
    registrations time $425.00 I have the JavaScript that will do that.
    Do I embed that in the fields by using an OnChange behavior? I
    can't find anything in the Help text telling me how to do
    this.

    Its not a good idea to do money calculations on the client
    because it can be
    scammed so easily. Pass the form data to the server and
    calculate there.
    <%= Clinton Gallagher
    "Flier46" <[email protected]> wrote in
    message
    news:e2dt46$hsr$[email protected]..
    >I am really new to this. I have used the tutorial with
    Dreamweaver to
    >create a
    > table based page. It is a registration form that has
    fields in the table
    > that
    > will need to be calculated. (# of registrations time
    $425.00 I have the
    > JavaScript that will do that. Do I embed that in the
    fields by using an
    > OnChange behavior? I can't find anything in the Help
    text telling me how
    > to do
    > this.
    >

  • Month calculations: DATE() vs EDATE()

    In a recent topic (Challenge to get a date correctly), I mentioned using the DATE function to calculate a date that is (for example) one month later than a given one. Specifically, if cell A1 contains the given date, then I suggested using this formula for a date one month later:
    =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))
    Yvan Koenig suggested instead using the simpler EDATE formula, here equivalent to:
    EDATE(A1,1)
    There is, as it turns out, more than simplicity in favor of Yvan's approach. While one might expect the two formulas always to produce the same results, they do not! This is easily seen by constructing the following three column table with a column header:
    1. In cell A2, enter the last day of the first month of this year (January 31, 2008 in the U.S. system, for example). In the cell below it, enter the last day of the second month of this year (Feburary 29, 2008, for example).
    2. Next, select both cells & use the circular fill handle, drawing down to fill the column with a year or so of last-day-of month values.
    3. Select cell B1 (a header cell) & enter in the formula bar & press return:
    =DATE(YEAR(A),MONTH(A)+1,DAY(A))
    4. Likewise, in cell C1 enter:
    =EDATE(A,1)
    Note that the B & C column values are sometimes the same, sometimes not. The same results occur if the "1" in both formulas is replaced with another number of months.
    What seems to be happening is the 'MONTH(A)+n' expression uses the number of days in the month of the "A" cell value as the basis for the 'n months later' calculation, which is not the convention usually used for such things as billing cycles. The EDATE formula follows the normal convention, & is thus the preferred choice for almost all uses imaginable ... unless perhaps you are the one being billed.
    This also applies to 'YEAR(A) + n' calculations.
    So, it would seem that any calculation involving the DATE(year, month, day) form with an arithmetic operator in the year or month element should be used only with great care, if at all.
    BTW, the comments about the month unit of calendar time having "no real purpose today" in http://www.cl.cam.ac.uk/~mgk25/iso-time.html may be of interest.

    I'm aware of the blue warning triangle appearing in these "overflow" situations; however, even when it does not, the results may be different -- for example, with a starting date of January 31st, adding one month in my long formula produces a month argument that is in bounds but (for 2008) yields a date 2 days later than with the EDATE method.
    I don't view this so much a bug as a consequence of the vague nature of the "n months later" or of the "month offset" concept. As the cited scholarly article points out, the concept of the months of the year are of somewhat obscure mystic origins, & there lengths were arbitrarily set, often for reasons more political than practical. Between the 1st & 28th day of any month, the concept is unambiguous -- it is the same numbered day in the other month, but for the 29th through 31st day of the month it is not, depending on the starting month.
    From what little I have been able to discover from casual research, the EDATE results are the standard more by custom than by any well-defined rule: what we mean by the offset references the first, last, or some near-the-end-of-the-month day number, whichever seems the most suitable at the time.
    I do not have Excel on my Macs, but since the functions are similar, I would be interested in learning how that application behaves with this table.

  • Can I upload forms I created in Acrobat Pro (containing Javascript) add attachment fields to them?

    I am developing fillable forms for our company. We have the following requirements.
    1. Develop the forms in Acrobat Pro.
    2. They contain extensive JavaScript, including custom functionality to validate the fields on the form before saving.
    3. The forms must include some way to allow the users to attach files when requested.
    4. Each form will be sent out to multiple recipients.
    5. Recipients may not have Acrobat--only Reader.
    I have solved most of the problems, and I'm getting stuck on #3 (because of #5). Short of using LiveCycle Reader Extensions (which I do NOT have), I don't know how to get a Reader-extended fillable PDF to allow attachments. I want to know if FormsCentral allows it. I read the online help and tried a test form, but I don't see how to add an attachment field to it after it's uploaded--it appears to be in a "final" status that can only be sent out to recipients after that.
    Any help is appreciated. Thanks!

    Acrobat 8 Professional includes LiveCycle Designer 8, so if the form was created with LiveCycle Designer 8 or older, the yes should have the option to edit the form. Acrobat 8 Professional under the menu option 'Forms' will have an option to open the form in LiveCycle Designer. If the form was created with a newer version, there could be some issues with newer features not available in version 8.

  • Inserting dynamic calculation in javascript to the stage

    I'm working with a partner on calculating the area of a rectangle, as a user changes its size. We're using javascript and so far have:
    function calculateArea() {
    var width = +document.getElementById("width").value;
    var height =+document.getElementById("height").value;
    var area = width * height;
    document.getElementById("area").value = area;
    Width <input type="Text" name="width" id="width" size="4"> 
    Height <input type="Text" id="height" name="height" size="4" onkeyup=""> <br><br>
    Area <input type="Text" name="area" id="area" size="4"> <br><br>
    <input type="button" name="calculate" id="area" size="4" onclick="calculateArea()" value="calculate">
    The main problem is that we're having difficulty getting the result of the calculation to show up in a textbox on the stage. 
    The subproblem is that because we can't see the result, we don't know whether the code is calculating correctly!
    Any help would be appreciated!

    You can use the command console.log() to post the info to the console, and see that in your browser's console.  If you want to have it show up in your textbox, you can refer to it like this:
    Assuming the name of the element is "myTextBox":
    sym.$("myTextBox").html(area.toString()); // use toString() because area is a numeric value
    Hope that helps!
    -Elaine

  • Adobe Acrobat X Pro - Javascript for submit button

    Hi,
    I am new to Adobe Acrobat X Pro and I have just designed a fillable form and enabled user rights for reader, for them to send the form back as a PDF. I created the form with a submit button and have mailto:[email protected] but I want to know if it is possible to create a button that will run a javascript to bring up a persons Mircosoft Outlook contacts, so they can choose who they want to send the completed form too.
    Any help would be greatly appreciated.
    Thanks.

    See post #7 and #10 in the following topic: http://forums.adobe.com/thread/793083?tstart=0

Maybe you are looking for