How to calculate a date in the future and set it as field value?

I'm trying to set the value of a read-only field to a date and time 72 hours from the current date and time. Here's how I'm doing it now:
var futureInMilliseconds = new Date().getTime() + 259200000; // current date and time + 72 hours in milliseconds
field.value = new Date(futureInMilliseconds);
The field is formatted as "m/d/yyyy h:MM tt". When I test this in the debugger I see it listing the correct date and time in the future, but the value applied to the field is always the current date and time. So, I'm having a difficult time getting this to work for something that should be fairly straight forward and simple. I'd appreciate any suggestions.

What is the "field" object?
What happen when you use "event" for the object and not "field"?
Even if this script is placed at the document level or any other location, it is still a calculation. It just not a field Custom Calculation Script. You are adding one value to another to get a new value.

Similar Messages

  • TS4006 The iPod is offline and pending to erase, how can I cancel  remote erase the content and setting?

    How can I cancel the remote erase the content and setting of my iPod touch by ( find my iPhone apps)? The iPod touch is offline and pending to erase! Please help!! Urgent

    You can't cancel an erase command.

  • How to display a date in the future?

    Hello,
    I play sport every Thursday. On my website I want to be able to display the date of the next Thursday that we are meeting. I want to be able to do this on an a continual basis. i.e. When someone looks at my site on Friday, it will display the actual date that the next Thursday falls on, and so on.
    Can anyone help with how to code this?
    Cheers
    Mitch

    use cal = Calendar.getInstance() to get the current date/time
    use cal.get(Calendar.DAY_OF_WEEK) to get what today is
    calculate n = days to next Thursday
    advance the calendar with cal.add(Calendar.DATE, n).

  • How to calculate start date of the week based on week number ?

    i need to get week number of the current date and based on that i need to calculate start date falling in the same week for last year.
    Eg. today is 31st week of year and 31st july date. so what will be the date on the 31st week of last year. i need the start date of that week.
    we can calculate the week number by select to_char(sysdate,'ww') from dual.
    DO we have a single line query for that or will it require writing a pl/sql block ?

    you can try following query
    it can be as inline but for more clean look and create it as select with include select
    with t as
    (select sysdate as dt from dual)
    select to_char(prev_year_dt - to_char(prev_year_dt, 'D') + 1, 'DD.MM.YYYY') as start_of_week from (select
    -- get day from prev year with the same week number
        case
               when to_number(to_char(add_months(dt, -12), 'WW')) > to_number(to_char(dt, 'WW')) then
                dt - (to_number(to_char(add_months(dt, -12), 'WW')) - to_number(to_char(dt, 'WW'))) * 7
               when to_number(to_char(add_months(dt, -12), 'WW')) < to_number(to_char(dt, 'WW')) then
                dt + (to_number(to_char(dt, 'WW')) - to_number(to_char(add_months(dt, -12), 'WW'))) * 7
               else
                add_months(dt, -12)
           end as prev_year_dt
      from t) t1good luck
    Sergii
    'Monday' is not first day of week in 100% ;)
    Edited by: Galbarad on Jul 30, 2012 11:00 PM

  • How to search for data on the web and return to jsp

    I need to collect data from a web site and return that data to my jsp file. The page should consist of a web page in which the user search for available flights then I conect to easyjet automatically fill in the form and return the result from easyjet.com to my jsp file..Do anyone know how can I do this?? I need to use java for this and not cgi..I found also some JavaScripts that can perform the same thing..Thanks...

    Hi,
    are you able to change dynamically the  operation.url = "assets/data/shopping.xml";?
    i need to do that based on the users input.
    Thanks in advance,

  • How to remove web data from the top and bottom of my Ebay invoices so I can print them without it.

    When I create my Ebay invoices, (which are generated through the browser in a new window) data is also generated at the top and bottom that I don't want to show on the invoice. The data is the date and time at the bottom, together with the page number, and at the top it shows the web location. In Explorer, you can remove this before printing but I can't work out how to do it in Firefox. Help please!

    Hello!
    You can change that in Page Setup, choose the "Margins & Header/Footer" tab and chose "--blank--" instead of the data that you don't want it to appear.
    You can visit [https://support.mozilla.org/en-US/kb/how-print-websites#w_margins-and-header-footer How to print websites] for more details.
    I hope that helps,
    Have a nice day

  • How can I get back to the future?

    I have a 15" MacBook Pro running 10.6.8.  Last night I upgraded to Lion and honest to goodness I'd rather have a Windows PC.  I have only to programs for which I use a computer -- Adobe PhotoShop CS2 and Bible software,for both of which I paid near $600 -- neither of which are supported in Lion.  Is it possible to get back to 10.6.8 without loosing everything on my hard drive?  Thank you kindly.

    As far as I know, Apple mail itself is not directly compatible between 10.7 and 10.6.   This gives you a couple options.  You could:
    1. Buy an external hard drive, partition it for room, install 10.6 onto it, and install Photoshop, your Bible program, and use 10.7 for everything else on your internal, and a second partition act as an exact clone of your internal.     You will probably need to contact Adobe to register your external hard drive as the registration code for its Photoshop.  Partitioning is described here: http://docs.info.apple.com/article.html?artnum=61301   
    Cloning is described on my FAQ*:
    http://www.macmaps.com/backup.html
    Lastly, I'd make a second clone of the first to ensure you don't lose data in the future, and manage both clones.
    2. More complicated would be to export your applications to all 10.6 compatible formats.  Mail would have to be copied to an IMAP account.    Addressbook exported to vCard.  iTunes and Office are thankfully already compatible. Once that is all setup, you would clone your machine twice.  Next you'd erase and install 10.6.   You'd then copy your Users -> yourname -> Music folder from the backup, and the Users -> yourname -> Documents folder on your backup to your 10.6 Users -> yourname folder, and copy the supporting preferences of Photoshop, and your bible program to the relevant folders.   Lastly you'd open Photoshop and work with Adobe on reregistering your Photoshop to your 10.6 machine.   In the future always keep at least two clones of your data before installing any updates, and read the tips on upgrading like those on my FAQ*:
    http://www.macmaps.com/upgradefaq.html

  • How do I set an email to send at a specific time/date in the future e.g. tomorrow at 9am. I am on an iMACX using apple's version of windows

    how do I set an email to send at a specific time/date in the future e.g. tomorrow at 9am. I am on an iMAC using apple's version of windows

    apple don't have a version of windows
    only microsoft have windows
    as how one automatate windows to send mails at a time
    googled it for you
    http://www.howtogeek.com/125045/how-to-easily-send-emails-from-the-windows-task- scheduler/
    more options in the search
    https://www.google.dk/search?client=opera&q=automatically+send+email+in+windows& sourceid=opera&ie=UTF-8&oe=UTF-8

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • Iphoto changes the date on some events to a date in the future

    I went into my iphoto and noticed some events had been changed to a date in the future.  It seems to do it on random events. It also grouped all of my videos into one event dated the end of May.  Does anyone know what causes this and how to prevent it? 

    Make a temporary, duplicate copy of your library and apply the three fixes in order as necessary.
    Fix #1
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your HD/User/Home()/ Library/Preferences folder.
    2 - delete iPhoto's cache file, Cache.db, that is located in your HD/User/Home()/Library /Caches/com.apple.iPhoto folder. 
    3 - launch iPhoto and try again.
    NOTE: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    Fix #2
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #3
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Applicatons that are superseded with a deadline date in the future, kicks of before deadline date has been passed.

    So how to explain this as best as possible....
    First off, I have seen this "issue" since ConfigMgr 2012 RTM and I have seen it continuously through the various upgrades done on the way to ConfigMgr 2012 R2. The environment consists of a single AD domain, one ConfigMgr Primary site with 30 DP's
    and 1500 computers.
    Application B is created and it should supersede application A. The application is present on all computers throughout the environment. The application is distributed to all DP's. The deployment of application A is targeted to a collection containing all
    computers. Then the deployment of application A is deleted. Application B is then configured to supersede application A with an uninstall of application A and the deployment type is replaced with the deployment type of application B. The option that Allows
    users to see older deployment types is not selected. Now application B is deployed to the same collection as application A was. The deployment settings are configured with a deadline date in the future (to match the corporate maintenance window - not a ConfigMgr
    maintenance window), but the application should be visible for users who want to upgrade before the deadline is reached. The option of automatically upgrading any superseded versions of the application is selected. The deployment is not created as a required
    deployment, but only available.
    What happens after the above is done is a bit odd. If I compare a application deployment that is superseded, to the Software Updates that normally have the same psychological effect on users (for anyone in IT this is common knowledge to be: Postpone and
    don't bug me again until deadline has passed and then becomes a forced installation/update, for about 70% of the user mass) this is not the case. After about 24 hours about every single computer that is online has received the deployment of application B and
    has been successfully installed. I refuse to believe that close to a 100% of the users actually select the option to upgrade application B before the deadline has been passed.
    I have checked the above and it looks like it does not honor the deadline given and finds out that when it can kick of the deployment, it does.
    This also happens if I don't delete the deployment of application A and leave it deployed to the same collection as the superseding application B is deployed to.
    Any ideas on why I'm seeing this behavior would be greatly appriciated.
    /Tom Erik

    Well, it's an available deployment. The only thing that it should do is to upgrade the superseded application, if present on the computer and that is set to be performed several weeks in the future. In the particular example (log files) below, the deadline
    is set to be on 1 April 2015 (!). All deployments are set to use client local time, when deployed to a computer collection. All other user (if I remember correct) deployments are set to use UTC, as client local time is not an option.
    What I do see on a particular computer is that when no user was logged on, the deployment started the application installation. This is what I found in the AppEnforce.log (notice the time stamp around the 18th at 13:42):
    +++ Starting Uninstall enforcement for App DT "Install Microsoft Office 2010 w/SP2 - x86 - Windows Installer (*.msi file)" ApplicationDeliveryType - ScopeId_5A0DA406-A98B-4302-9061-7A14FC9FCC1E/DeploymentType_7edd6b29-eb40-4019-a0c6-04da65e3407a, Revision - 4, ContentPath - C:\WINDOWS\ccmcache\o1, Execution Context - System AppEnforce 18.02.2014 13:42:20 1164 (0x048C)
    A user is not logged on to the system. AppEnforce 18.02.2014 13:42:21 1164 (0x048C)
    Performing detection of app deployment type Install Microsoft Office 2010 w/SP2 - x86 - Windows Installer (*.msi file)(ScopeId_5A0DA406-A98B-4302-9061-7A14FC9FCC1E/DeploymentType_7edd6b29-eb40-4019-a0c6-04da65e3407a, revision 4) for system. AppEnforce 18.02.2014 13:42:21 1164 (0x048C)
    +++ Discovered application [AppDT Id: ScopeId_5A0DA406-A98B-4302-9061-7A14FC9FCC1E/DeploymentType_7edd6b29-eb40-4019-a0c6-04da65e3407a, Revision: 4] AppEnforce 18.02.2014 13:42:21 1164 (0x048C)
    App enforcement environment:
    Context: Machine
    Command line: setup.exe /uninstall ProPlus /config uninstall_config.xml
    Allow user interaction: No
    UI mode: 0
    User token: null
    Session Id: 4294967295
    Content path: C:\WINDOWS\ccmcache\o1
    Working directory: AppEnforce 18.02.2014 13:42:21 1164 (0x048C)
    Prepared working directory: C:\WINDOWS\ccmcache\o1 AppEnforce 18.02.2014 13:42:21 1164 (0x048C)
    Prepared command line: "C:\WINDOWS\ccmcache\o1\setup.exe" /uninstall ProPlus /config uninstall_config.xml AppEnforce 18.02.2014 13:42:22 1164 (0x048C)
    Executing Command line: "C:\WINDOWS\ccmcache\o1\setup.exe" /uninstall ProPlus /config uninstall_config.xml with system context AppEnforce 18.02.2014 13:42:22 1164 (0x048C)
    Working directory C:\WINDOWS\ccmcache\o1 AppEnforce 18.02.2014 13:42:22 1164 (0x048C)
    Post install behavior is BasedOnExitCode AppEnforce 18.02.2014 13:42:22 1164 (0x048C)
    Waiting for process 5108 to finish. Timeout = 120 minutes. AppEnforce 18.02.2014 13:42:22 1164 (0x048C)
    Process 5108 terminated with exitcode: 3010 AppEnforce 18.02.2014 13:51:27 1164 (0x048C)
    Looking for exit code 3010 in exit codes table... AppEnforce 18.02.2014 13:51:27 1164 (0x048C)
    Matched exit code 3010 to a PendingSoftReboot entry in exit codes table. AppEnforce 18.02.2014 13:51:27 1164 (0x048C)
    ++++++ App enforcement completed (547 seconds) for App DT "Install Microsoft Office 2010 w/SP2 - x86 - Windows Installer (*.msi file)" [ScopeId_5A0DA406-A98B-4302-9061-7A14FC9FCC1E/DeploymentType_7edd6b29-eb40-4019-a0c6-04da65e3407a], Revision: 4, User SID: ] ++++++ AppEnforce 18.02.2014 13:51:27 1164 (0x048C)
    And this kind of corresponds with what I can see in the ServiceWindowManager.log (again, notice the timestamp at 13:42):
    OnIsServiceWindowAvailable called with: Runtime:1, Type:6 ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    Biggest Active Service Window for Type=6 not found ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    Program cannot Run! Setting *canProgramRun to FALSE ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    WillProgramRun called with: Runtime:1, Type:6 ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    A Service Window of this type exists. ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    There exists a Service Window of this Type, for this duration. The Program will run eventually. ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    ServiceWindowManager 18.02.2014 05:00:00 3924 (0x0F54)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 13:42:17 5504 (0x1580)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 13:42:17 5504 (0x1580)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 13:42:19 3396 (0x0D44)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 13:42:19 3396 (0x0D44)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 13:51:27 5704 (0x1648)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 13:51:27 5704 (0x1648)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 13:51:28 756 (0x02F4)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 13:51:28 756 (0x02F4)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 14:03:52 5060 (0x13C4)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 14:03:52 5060 (0x13C4)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 14:03:52 6096 (0x17D0)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 14:03:52 6096 (0x17D0)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 14:04:12 4192 (0x1060)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 14:04:12 4192 (0x1060)
    OnIsServiceWindowAvailable called with: Runtime:7200, Type:2 ServiceWindowManager 18.02.2014 14:04:14 5828 (0x16C4)
    No Restricting Service Windows exist. It can therefore run... ServiceWindowManager 18.02.2014 14:04:14 5828 (0x16C4)
    There are no maintenance windows configured in ConfigMgr at all for any collections.
    /Tom Erik

  • FPBW: Extract Open Items with a posting date in the future

    Dear all,
    I'm are currently searching for possibilities to extract Open Items with a posting date in the future from SAP IS-U 4.72 into SAP BW 3.5.
    Currently I'm using the Business Content extractor 0FC_OP_01 together with the mass transaction FPBW in IS-U.
    The problem I'm facing is within the mass transaction FPBW. I've have set the key date at 01.11.2007, but this job already runs for 52.000 seconds on the same database select-statement.
    Does anybody know a possible solution to improve the performance of the statement below? (I pasted it from the process overview)
    ================================
    SELECT
    /*+
      INDEX("DFKKOP" "DFKKOP~1" "DFKKOP^1" "DFKKOP____1" "DFKKOP____1__X" "DFKKOP_1")
      "BETRH" , "BETRW" , "BUDAT" , "BUKRS" , "FAEDN" , "GPART" , "GSBER" , "INKPS" , "SPART" , "VKONT" ,
      "WAERS" , "MAHNV" , "ABWBL" , "APPLK" , "AUGBD" , "AUGBL" , "AUGBT" , "AUGDT" , "AUGRD" , "AUGST" ,
      "AUGWA" , "BLART" , "BLDAT" , "EMGPA" , "GRKEY" , "HVORG" , "MANSP" , "MWSKZ" , "OPBEL" , "OPSTA" ,
      "OPUPK" , "PERSL" , "PYMET" , "QSSHB" , "SBETW" , "SPZAH" , "STUDT" , "TVORG" , "VTREF" , "XBLNR" ,
      "XMANL" , "HKONT" , "OPUPZ" , "OPUPW" , "STAKZ" , "WHGRP" , "AUGBS" , "XANZA" , "XRAGL" , "ABWTP" ,
      "ASTKZ"
    FROM
      "DFKKOP"
    WHERE
      "MANDT" = :A0 AND "AUGST" = :A1 AND "GPART" BETWEEN :A2 AND :A3 AND ( "AUGDT" = :A4 OR "AUGDT" > :A5
      AND ( "BUDAT" <= :A6 OR "AUGBD" <= :A7 ) OR "WHGRP" <> :A8 AND "OPUPW" = :A9 )
    ORDER BY
      "AUGST" , "GPART"#
    =================================
    I have already tried to create an index on the following fields (in the same order):
    - MANDT           Client
    - AUGST           Clearing status
    - GPART           Business Partner Number
    - AUGDT           Clearing date
    - BUDAT           Posting Date in the Document
    Any help would be appreciated!
    Thanks in advance,
    Steven Groot

    Hi Marcos,
    When you have created the Restricted keyfigures for Open Items, You have to add the date characteristic on which you are looking open item and add the variable there.Here you have to use a variable of type Interval and select the operator "<" the date of the Variable.If you go through, there are standard variable for keydate, which you can use directly.
    Hope you got the idea
    Regards
    Happy Tony

  • How can I POST data within the same page if I have a A HREF -tag as input?

    How can I POST data within the same page if I have a <A HREF>-tag as input? I want the user to click on a line of text (from a database) and then some data should be posted.

    you can use like this or call javascript fuction and submit the form
    <form method=post action="/mypage">
    cnmsdesign.doc     
    </form>

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.

    Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

Maybe you are looking for

  • Vertical Partition

    I have a order transaction table as subitem level. The table order_subitem is 30 column table with 300 million rows and is about 60 GB is size. The table has been denormalized to make user query faster. Will breaking the table in to 4 tables (normali

  • Disp+work.exe is stopped, Database is Down

    Dear All, Our Production Server is in the cluster mode. Disp+work.exe is stopped Database is down Database : MS SQL 2005 Server OS: Windows 2003 32 bit Kindly help us to start the database. In the Services we have 5 SQL Server Services: 1. SQL Server

  • Selection color in jtable

    I've noticed one annoying thing about JTable when running under Windows L&F. Namely, a table without focus renders its selection in the same color as a table with a focus. This can get really annoying especially with windows where containing more tha

  • Will the new iPad be released at 5pm on March 16th or when stores open?

    Will the new iPad be released at 5pm on March 16th or when stores open?

  • How to read inferrable attributes

    Hi , I am trying to generating the PDF document of the whole session at the end of the goal acheived . Now, In the xsl transformation(xsl:fo) I want to read some inferrable attributes of the global entity instance . is there any way to acheive this?