Javascript for calculating End Date

I have two date fields "Start_Date" and "End_Date". User selects the start date. Then the form takes that date and adds 365 days. puts the result in the "End_Date" field. I have attempted a couple of scripts and none have worked. So I attempted to first just get the selected date in the "Start_Date" field to show in the "End_Date" field. When I select a date like, "May 28,2008" the output reads "Object44194500". Using the following script in the "Start_date" field
----- form1.Order_Page.Product_Table.Row4.Subscription_Start::change: - (JavaScript, client) -------
xfa.resolveNode("form1.Order_Page.Product_Table.Row5.Subscription_End").rawValue = this;
What am I doing wrong. How do it get it show currently while at the same time adding 365 days. So if the user select May 28, 2008 the output in the "End_Date" field is May 27, 2009??? Thanks
- a frustrated new developer of LiveCycle Designer 8.0...

I was able to find an answer on the LiveCycle Google Group. Here is what I was given. (for some reason I only got the FormCalc version to work).
-----------Begin Code--------------
if(EndDate.rawValue != null && StartDate.rawValue != null)
if(EndDate.rawValue < StartDate.rawValue)
xfa.host.messageBox("Please check your End date. It cannot be before
the Start date!", "Date Checker", 3);
this.rawValue = null;
// to set focus to the End Date field so that the user can type his
new value..
xfa.host.setFocus(this.somExpression);
Alternatively.. this must work if it is formcalc...
if(EndDate.rawValue <>null and StartDate.rawValue <> null)then
if(EndDate.rawValue < StartDate.rawValue) then
xfa.host.messageBox("Please check your End date. It cannot be before
the Start date!", "Date Checker", 3)
$.rawValue = ""
// to set focus to the End Date field so that the user can type his
new value..
xfa.host.setFocus(this.somExpression)
endif
endif
-------------End Code ----------------

Similar Messages

  • OIM 11g Modify User Profile for Updating End Date

    Hi Gurus!
    We have an OIM implementation where users may request the creation of other users by means of a Create User request template. In this template we set the End Date to be 3 months after the request date.
    In order for the requester to extend the period of a user's OIM user account (along with its provisioned resources) we customized a Modify User Profile by displaying the End Date field and automatically populate it again to 3 months after the request date. Also we developed a custom event handler to enable the user when it is disabled and the End Date is updated to a future date.
    This Modify User Profile is working great when the user is still enabled (the End Date is still in the future), however, when the End Date has passed (and the user is Disabled) the requester is not able to see the user when selecting the Modify User Profile request template.
    Is there a way to allow requesters to also see disabled users in the Modify User Profile request template?
    Thank you in advance.
    Regards,

    Hi Kevin,
    thanks for your reply!
    But, in this case, when the user is already disabled due to his End Date, how can a requester, through the Self Service TAB, enable it?
    The Enable User request template does not work since when trying to enable the user, OIM sees the End Date is already passed and the DataSet validation throws an exception.
    The only way I saw was providing a Modify User Profile Request template to change the End Date and developing a custom event handler to enable the user upon the extension of the End Date...
    How can, in this situation, a requester enable the user and extend its End Date?
    Thank you!
    Regards,

  • Tables for Basic end date and work center for operation

    Hi!
    I need table name to fetch the basic end date of a maintenance order and maintenance work centers with respect to each operation in maintenance order.
    Regards,
    VM
    Edited by: V M on Jul 20, 2010 7:22 AM
    Edited by: V M on Jul 20, 2010 7:35 AM

    Hi VM,
    Input is Order Number (AUFNR).
    You can find the Basic End date of Order in Table AFKO, filed is GLTRP.
    For work center in Operations, you can use the Table AUFPL from AFKO.
    Pass this AUFPL in AFVC and get the ARBID.
    Then pass this ARBID to CRHD Table as OBJID, and get the work Center (ARBPL)
    Regards,
    MLN Prasad

  • CIF of SA is not consistent for Validity End Date

    Hello gurus,
    Our company is quite new in using SNC, and we bumped into this problem (see description below), and hopefully this forum can help us.
    <Description>:
    When the Scheduling Agreement is CIFed from R/3 (ECC) to SNC, the Validity End Date does not get updated each time.
    It gets updated sometimes, but not always. It is inconsistent behaviour.
    <Example>:
    Scheduling Agreement A
    Validity End Date: 31.12.2012 Changed to 30.11.2012 in R/3.
    Performed CIF using Transaction Codes CFM1 and CFM2.
    Correctly updated the Validity End Date in SNC.
    For the same Scheduling Agreement A updated Validity End Date to 31.01.2013 in R/3.
    Performed CIF using Transaction Codes CFM1 and CFM2.
    The Validity End Date was not updated in SNC & remained as 30.11.2012.
    For the same Scheduling Agreement A updated Validity End Date to 15.10.2012 in R/3.
    Performed CIF using Transaction Codes CFM1 and CFM2.
    The Validity End Date was not updated in SNC & remained as 30.11.2012.
    Thanks guys
    Tuffy

    Hi Tuffy,
    1 - I am just wondering if after the Delete the existing External Procurement Relationship in SNC, and CFM1 and CFM2 the SA (i.e. changed my validity end date value) to the SNC, will the problem of the SNC side not able receive the changed SA??
    When there is a change in the SA, integration model would create the same in SNC if it does not exist. But the transfer from ERP does not happen just like that. First, make sure that the message type (CIFSRC) has been checked in BD50 and then schedule a job to periodically transfer the SAs.
    2 - What does the tcode the person in the SNC side have to double check to ensure the SA is transmitted there??
    The t-code is /SAPAPO/MTI2 - External Procurement Relationship.
    3 - Someone in our company advise BASIS team to check the transactions BD50 and BD52. What exactly does it mean and does it help?
    This is correct. I mean guys who are responsible for Integration model need to set-up BD50, BD52 so that changes to SAs are transferred periodically.
    Regards,
    Sandeep

  • Status for loading end date when GR

    Hi! We are using shipment for imports. I have set the indicator 'Cumulate 'finish loading' status from inbound deliv. sts 'gds rcpt completed' for the shipment type. But on receipting the inbound delivery, the status is still not set in the shipment created (loading end date field).
    Does anyone know what else need to be done for the date to be populated?
    Regards
    SF

    No answer

  • Javascript for exporting form-data from spawned pages in csv-table

    Hello,
    I need your help with a problem concerning acrobat.
    I created a form. The user can spawn new pages from a template.
    The fields have the format Pn.templatename.fieldname, for example: P0.form.kosten1
    The user fills the form, saves the file and sends it to me.
    Now I have to get a CSV- or Excel-Table from this Data.
    The Export-Function doesn't work, because of the different fieldnames.
    Does Javascript work?
    Perhaps I can create a 2-dimensional array and then write it to a csv-file??
    Has anyone a good Idea?
    Thank you for helping.
    Many greetings,
    Thomas

    The only way I've found to do this is to open the form in Acrobat, click Forms, mouse over Manage Form Data, then click Export Data. Your only options are to save as .xml or .xdp. I saved my data as .xml. I was then able to import the .xml file into excel by clicking Data, mousing over xml, clicking Import... and browsing to the Acrobat generated .xml file. I know this is convoluted but it's the only way I've found to get the data into a spreadsheet. Acrobat exports the data as filename_data.xml, i.e. a form named contacts will export it's data as contacts_data.xml. Be aware, I've only tested this on a form that had a table in it and nothing else. If your table is part of a form with other fields in it I have no idea how the other data will look after exporting.

  • Pay day for period end date as mid month.

    Hi All,
    plz suggest how to proceed.
    Payroll period starts from 15th of month to 14th of next month and payday is last working day of month having period end day.
    Example
    Period start day  15th April
    Period end day  14th May
    Pay day   last working day or last day of May for period 15th April to 14th May.

    Hi,
    I think what you are meeting with is Monthly End Accrual (MEA) senario.
    Pls check the following URL in PY US solutions:
    http://help.sap.com/saphelp_46C/helpdata/EN/d8/c9e93401bdee06e10000009b38f83b/frameset.htm
    The related node is under :
    Payroll United States (PY-US)->Final Payroll Processing (PY-US-FP)-> Month-End Accruals Concept
    Br,Kee

  • Javascript for multiple date fields

    Hi all-
    I have to write javascript for 15 different date fields in a form.
    The requirement here is that we convert all date fields on Page 100 from date pickers (editable date fields) to display-only date fields with two controls for the users to set the date.
    If the field is empty (no date registered yet), there will be a green checkmark(X). When the user clicks this checkmark, the current date is entered into the field.
    If the field is not empty (there is a date already in the system), there will be a red X. When the user click this red X, the date from the date field is removed.
    The javascript I am using here is
    </script>
    <script type="text/javascript">
         function init(){
              var datePickerVal = $v2('P100_TODAYS_DATE');
              if(datePickerVal){
                   $x_Show('ToggleDateR');
                   $x_Hide('ToggleDateG');
              }else{
                   $x_Hide('ToggleDateR');
                   $x_Show('ToggleDateG');
         function toggleDateFunc(pValue){
              var sysDate = $v2('P100_DATE');
              if(pValue == 'R'){
                   $x_Hide('ToggleDateR');
                   $x_Show('ToggleDateG');
                   $x_Value('P100_TODAYS_DATE','');
              }else if(pValue == 'G'){
                   $x_Show('ToggleDateR');
                   $x_Hide('ToggleDateG');
                   $x_Value('P100_TODAYS_DATE',sysDate);
         window.onload = init;
    </script>
    This javascript is working for one date field( 'P100_TODAYS_DATE') but i have 15 different date fields in this page(100) all should have same funtionality. Please help me out how to write a logic to use this function for all the date fields.
    Thanks,(apex 3.2)
    Greenhorn
    Edited by: Greenhorn on Jul 19, 2011 12:30 PM

    Hi,
    You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
    Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
    Now modify you code as
    FOR i IN 1..30
    LOOP
    v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
    END LOOP;
    ....Now you have all date valus in array. Just write one update as follows
    UPDATE  TABLE1
    SET date1 = my_date_array[1], date2 = my_date_array[2]..
    WHERE ....Hope it helps :)
    Cheers,
    Hari

  • CRM-ISU: Need to change the END date and Start Date for contract items

    Hi,
    There is an old contract item for which  I need to change the end date
    and there is a new contract item for which I need to change the start date.
    I need to change the contract item end date and start date using some function module in IS-U system (may be as RFC to CRM).Pleaselet me know if any body is ware of this functionality?
    I am aware of a FM EECRM_CONTRACT_DATE_CHANGE which may be used for changing End Date
    but how to change the start date of a new contract item?
    Please let me know if any body is aware of this?
    Thanks

    Hi,
    Hope you can solve it by this [Link1|Re: Function modules; [link2|CRM material;.
    Regards,
    Surjith

  • Baseline date for payment due date.

    Hi,
    In FB60 and Miro, Baseline date for calculating due date for payment is taken as default as document date, as per setting in payment terms. But I want to take this date as date of GR/SE. Can we do this. I also want to make it gray and dont want user to change it. Please suggest how to do it.

    Hi
    go through the link answered by me.
    Re: Substitution - Baseline Date to be replaced by the Goods Receipt date
    the Goods receipt date can be defaulted as Baseline Date.
    tell your ABAP consultant to check the BADI and do the necessary.
    regards
    venkat

  • Need to use Value of End Date Prompt Multiple Times

    I have a date field (Ex: Tablename.RDate) that needs to be entered by the user. So, I created a prompt (Begin and End Dates) that the user will enter.
    I need to have a second date field (Ex: Tablename.TDate) that needs to use the entered value of the End Date from the first prompt.
    (I need to check for TDate being equal to or greater than the value entered in the RDate End Date prompt. I don't want the client to enter in a begin and an ending date and then have to turn around and enter in a termination date which would be the same as the ending date).
    So my question is how do I accomplish this without having a TDate prompt? How can I use the RDate Entered Ending Date prompt value multiple times in my report?
    I thought about a second prompt but I don't know how to direct it to the entered value for the 'End Date'. I am fairly new at this so please go slow and be detailed with your answer if you can. Thanks in advance

    I think you have to make use of an exit (EXIT_SAPLMEKO_002)  or a BADI (ME_PO_PRICING_CUST)

  • Java/java script auto generate END Date

    Hi,
    I have a jps page with 4 fields.
    1. drop down list
    2. text box
    3. start date
    4. end date
    the problem is
    text box will allow "number of days"
    start date will get date from user on popup window
    end date has to be generate based on text box value "no of days", another filed which will retrieve from db and start date
    ex:
    if text box values is <50 and start date (user selected date) is 02-04-2010 , the end date should add 8 days from the start date.
    now the problem is calculating end date based on the start date with no of days which is given by user.
    i have spend time to write java script, but i am not able to complete the entire logic.
    please give some idea whether it can perform by java script or java bean.
    Thanks,
    Jasmin Rosline

    now the problem is calculating end date based on the start date with no of days which is given by user.
    Use the following code if you want to calculate in client side;
    <html>
    <script>
    function addVal(){
    var d = new Date(document.getElementById('dt').value);
    d.setDate(d.getDate() +eval(document.getElementById('dd').value));
    document.getElementById('result').value = (d.getMonth() +1) +"/"  + d.getDate() + "/" + d.getFullYear(); }
    </script>
    <body>
    <input type="text" id="dt" value="02/03/2011"/><br>
    <input type="text" id="dd"/><br>
    <input type="text" id="result"><br>
    <input type="button" value="add" onclick="addVal()"/>
    </body>Edited by: Pandiya on Feb 3, 2011 11:31 PM

  • Include those records that have Null End Dates

    I have to pull a report that show those who are currently working so we are assuming those with no End Dates are still working. When I put '0' or '0/0/00' for the End Date I get an error stating I need to put in a date.
    How do I only include those records that have Null End Dates? Ultimately I need a count of those currently employed. So I'm assuming once my report only shows those records I can add a running total field.
    I have Crystal XI.
    Thanks

    Try entering some default value for null like enter a default date "1/1/1900" which means that the end date is null.
    Now in the record selection write the condition like this
    if {?EndDateParameter}=date(1900,1,1) then
    (isnull(datefield)=true or totext(datefield)="")
    else
    datefield={?EndDateParameter}
    Regards,
    Raghavendra

  • Function Module for calculating NEXT MONTH's start date and End date

    Hi Friends,
    I want a function module which could calculate the next months start date and end date...
    Say my input will be like 01.01.2006(start date) it should return
    01.02.2006 and 28.02.2006...
    IS there any FM for this ... or how to go about this scenario ???
    thanks in advance
    Cheers,
    R.Kripa

    Hi kripa,
    1. There is no DIRECT Way.
    2. We have to do in 2 steps.
    3. See this code (just copy paste in new program)
       U can use its FORM anywhere in your program,
       for getting the desired dates.
    4.
    REPORT abc.
    DATA : sdate TYPE sy-datum,
           edate TYPE sy-datum.
    PARAMETERS : dt TYPE sy-datum DEFAULT sy-datum.
    PERFORM getdt USING dt sdate edate.
    WRITE :/ sdate , edate.
    INDEPENDENT FORM
    FORM getdt USING orgdate stdate enddate.
      DATA : mydate TYPE sy-datum.
      CALL FUNCTION 'HR_PSD_DATES_ADD_MONTHS'
        EXPORTING
          v_date             = orgdate
          V_MONTHS           = 1
       IMPORTING
         E_DATE             = mydate
       EXCEPTIONS
         NOT_POSITIVE       = 1
         OTHERS             = 2
      CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
        EXPORTING
          iv_date             = mydate
        IMPORTING
          ev_month_begin_date = stdate
          ev_month_end_date   = enddate.
    ENDFORM.                    "getdt
    regards,
    amit m.

  • How to Calculate End-Date for a given Startdate in business hours without holidays

    Hello Experts,
    I need to create a plsql function where we need to determine end date for a task. For this, input will be only start date & number of hours allocated for that task. Based on this input we need to exclude Business hours & need to include only Business hours. and in the end we need to achieve the end date after the hour addition to the start date.
    Example : INPUT: 03-OCT-2013 12:00:00 PM /
                                  Hours Allocated 30 Hrs.
    Business Hours - 11 AM to 9 PM.
    So time starts from or Startdate is Friday 03-OCT-2013 12:00:00 PM. 
    So If I want to calculate the end-date by adding 30 hours to it, it should come WednesDay 09-OCT-2013 12:00:00 PM because I excluded Weekends & considered only business hours that is 11 am to 9 pm.
    I am not able to get any such guidance in Internet as most of the docs are having start & end date as input.
    Please help!
    Thanks in advance !!

    Hi,
    As Christ said, there's no nuilt-in Oracle function to tell whether a given DATE is a holiday or not, partially because there's so much local variation in holidays.  You can write a function like that (see http://forums.oracle.com/forums/message.jspa?messageID=3351081 ), but creating a table will be simpler and more efficient.
    I suggest creating a row for every date, whether it's a work day or not; that way, you can have variations in the schedule (e.g., schedule changes and
    partial holidays).
    CREATE TABLE  work_calendar
    (   dt  DATE       PRIMARY KEY
                       CONSTRAINT  work_calendar_dt
                           CHECK (dt = TRUNC (dt))
    ,   day_type       VARCHAR2 (8)  NOT NULL
                       CONSTRAINT  work_calendar_day_type
                           CHECK ( day_type IN ( 'HOLIDAY'
                                               , 'WEEKEND'
                                               , 'WORK DAY'
    ,   start_time     DATE
    ,   end_time       DATE
    ,   work_hours     NUMBER
    ,   work_hours_since_1970     -- or some point earlier than you'll ever need
                       NUMBER
    ,   CONSTRAINT  work_calendar_start_time
            CHECK ( TRUNC (start_time) = dt)
    ,   CONSTRAINT  work_calendar_end_time
            CHECK ( TRUNC (end_time) = dt)
    This will let you do a lot of the calculations you need without a function.

Maybe you are looking for

  • An error occurred while trying to connect to a Web service, when InfoPath web enabled form loads.

    Hi Everyone, I am getting an error message: An error occurred while trying to connect to a web service, when my InfoPath form tries to load.  The last few days, it only spits this error message in the morning and around 12pm-1pm it resolves itself an

  • Difference in Trial balance A/c (WIP) & FBL3N

    Hi All Account balance difference The Inventory WIP(GL Code xxxxx) value as per Trial balance and as per statement of a/c (fbl3n) is not tallying. The same gl shows different values in fbl3n,fs10n & trial balance statement fs10n balance and trial bal

  • Can not copy planning application in EAS?

    the copy option is blanked out for planning application, but fine with other applications. this is 11.1.2.3, not see this previous version.

  • Document created, not to be accessed unless released

    hi all i have one question i have a document created with the following status network. created> checked> released. once it is created, i dont want others to access the document unless it is released, is it posssible? if so, how it can be ...... Rega

  • Current year Previous Year in Query

    Hi, I have to get the results of current year 12 months( 12 columns) previous year 12 month( 12 columns) in one report. Once the user gives the current year , how to automatically populate the previous year. The PY varaint can be used for all months