Locking a calculated date field

I have a date field on my form using the custom current date object included in Designer 8.2, which applies the following FormCalc script to the LayoutReady event of the field:
// Current Date in short-style date format.
$.rawValue = num2date(date(), DateFmt(1))
My problem is this: the date is set when the user fills out the form, as expected. However, whenever the form is subsequently opened, the date is updated to the current date. I need to have the field set initially when the user fills out and submits the form, and then make it static so that future reviews of the form show the initial date. I know this is probably something very simple, but I am missing it. Any suggestions?
Thanks in advance,
Angie

I found this script the other day that seems to do the trick:
if ($.rawValue==null)then
$.rawValue = [put your script here]
else $.rawValue
endif

Similar Messages

  • Calculating Date Fields in SQ01

    Hi Friends,
    I'm new to SAP so I apologize if my question sounds rudimentary.  I've created a query in SQ01.  I would like to be able to report on data from the current year regardless of the year.  My ultimate goal is to schedule the query to run as a batch job so I never have to touch it again.  Within my query I created a custom calculation field from which I can enter a formula for the date, however, it seems that I cant get the syntax correct. 
    Any direction would be appreciated.
    Thanks,
    Olyn

    Thanks Pratik for your response. There are two things which I would like to clarify with you before proceeding with this development.
    1> Is there a standard way by which we can control this requirement (mean without development) ?
    2> We are using EP 6 (Netweaver 2004s). If we do the custom development as suggested by you in CRM GUI, does this change reflect directly in PCUI? or do we need to do something in EP to reflect this change?
    Appreciate your inputs.
    Thanks
    Kumar

  • Click event to add (or subtract) a day to a date field

    I have a form that is giving me a little trouble. I want to be able to input a start date in one field, then input a number of days in another field, and then have it calculate a date that is that number of days away from the start date. The form is actually working ok for the most part, but there are a couple of issues I'm having.
    1. The end date is not calculating immediately upon exiting the number of days field. You have to tab all the way back to the start date and only when you exit that field does it calculate the end date. I need it to calculate when you exit the number of days field.
    2. I have added a little (+) and (-) button to be able to increase or decrease the date by one day. This works, but the problem is, I want to do this in the background. Meaning, I want the calculated date to change, but the # of days field to not change.
    So say I enter 12/1/2010 in the start date. Then I enter 1 in the # of days field. When I tab to the Calculated date field, it should immediately change to 12/2/2010. Then, if I click (+), the Calculated date field should go up to 12/3/2010, but the # of days field should stay at 1.
    I've uploaded a sample of what I have figured out so far here:
    https://acrobat.com/#d=v4c4KKdj0hesicxO8yO1pw
    Thanks so much for any help I can get on this!
    Jo

    I think this is what you are after. I moved the logic to the calculate event of the target date and added a numeric field to hold the result of adding/subtracting (called 'delta').
    // form1.#subform[0].date2::calculate - (FormCalc, client)
    var date1 = Date2Num(date1.formattedValue,"MM/DD/YYYY")
    $.rawValue = Num2Date(date1+days+delta,"MM/DD/YYYY")
    You could make 'delta' hidden.
    Steve

  • Date field difference calculation

    Hi all,
    I am new to Adobe and Java scripting so apologies if this has already been answered elsewhere - I have not been able to find it if it has.
    I want to calculate the difference between two dates fields in hours and mins on a form.
    I have two fields, both Date format (dd/mm/yyy HH:MM), a Start and End date and I want the difference between them in the Time format HH:MM.
    Can anyone help me with the script for this? What I have so far is:
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length)
    var dateStart = util.scand("dd/mm/yyyy HH:MM",strStart);
    var dateEnd = util.scand("dd/mm/yyyy HH:MM",strEnd);
    var diff = dateEnd.getTime() - dateStart.getTime();
    // One Day = (24 hours) x (60 minutes/hour) x
    // (60 seconds/minute) x (1000 milliseconds/second)
    var oneMin = 60 * 60 * 1000;
    var mins = Math.floor(diff/oneMin);
    event.value = util.printd("HH:MM",mins);
    But this is not working...
    Mary

    The result can be formatted using:
    // format result using "h:MM" format
    event.value = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    One cannot use the date or time formats since the time values will be limited to the hours and minutes values for 1 day, so any time value that is over 23 hours 59 minutes is not possible.
    A full script solution including document level functions for conversion of date strings to minutes and converting minutes to a time string:
    // reusable document level functions;
    function Time2Num(cFormat, cDate) {
    // convert date value with format to number of minutes form Epoch date;
    var oDate = util.scand(cFormat, cDate);
    var nMins =  null;
    if(oDate ==  null) app.alert("Error converting " + cString + " using " + cForamt);
    else nMins = oDate.getTime() / (1000 * 60);
    return Math.floor(nMins);
    } // end Time2Num format
    function Num2Time(cFormat, nMins) {
    // convert number of muniutes to h:MM or HH:MM format;
    // return formatted string for valid formats;
    // return null for invalid formats;
    var cElapsed = null;
    // test for nMins being a number;
    if(isNaN(nMins)) {
    app.alert("Minutes must be number",0, 0);
    } else {
    var nHours = Math.floor(nMins / 60);
    var nMinutes = Math.floor(nMins % 60);
    switch(cFormat) {
    case "h:MM":
    cElapsed = util.printf("%,0 0.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    case "HH:MM":
    cElapsed = util.printf("%,002.0f" + ":" + "%,002.0f", nHours, nMinutes);
    break;
    default:
    app.alert("Invalid format " + cFormat + "\nMust be \"HH:MM\" or \"h:MM", 0, 0);
    break;
    return cElapsed;
    } // end Num2Time function
    // end document level funcitons;
    // custom calculation script;
    event.value = ''; // clear result;
    var strStart = this.getField("StartTime").value;
    var strEnd = this.getField("EndTime").value;
    if(strStart.length || strEnd.length) {
    var nDateStart = Time2Num("dd/mm/yyyy HH:MM",strStart);
    var nDateEnd = Time2Num("dd/mm/yyyy HH:MM",strEnd);
    var nMins = nDateEnd - nDateStart;
    // format result using "h:MM" format
    event.value = Num2Time("h:MM", nMins);
    // end custom calculation script;

  • Help - all data fields in all my forms are locked in design view

    Working in LiveCycle Designer ES2 v.9 -  I have 10 forms that I've designed for my client. I opened them this morning to edit the design and all the data fields are locked. In the Hierarchy tab, the names are greyed out. I haven't done anything to the forms since saving last night. Some of the forms are really complex and and no way do I want to recreate them. I tried saving with a different name but that doesn't work either. NB. The forms work OK when opened in Acrobat (for filling). It's just the design edits in LiveCycle that I can't do, now.

    Thanks. I figured out that I had inadvertently clicked on (enabled) Lock Fields. It took awhile as when that is turned on, the menu item doesn't show that you've turned it on e.g. no check mark or default to "Unlock Fields". If it changed to "Unlock Fields",  I wouldn't have spent so much time trying to figure out what happened:o).
    Something the LiveCycle team may want to change in that menu.
    Penni

  • Calculating years between 2 date fields

    I am trying to build a form in LiveCycle Designer 7 to report missing persons.  I would like to populate a text field with the number of years between two dates entered in date/time fields; specifically using a missing person's DOB and the date they were last seen to calculate their age when last seen.
    Any assistance would be greatly appreciated.
    Thanks
    Drew

    Greetings,
    I need an age in months and years.
    On my LiveCycyle form I have two date fields 'dob' and 'rdtestdate'.  I am in Australia so we use dd/mm/yyyy as the format.
    The field designated to display the calculated result -- 'rdage' -- is set as a calculated-read only text field.
    What javascript/formcalc code would I use to calculate the age in years and months, please?
    I've been studying and testing the various solutions but don't understand well enough, sorry!  When I paste in a sample and change the field names to match mine, my result remains empty.  Sometimes I get a failed script message as I try to save the form.    I've tried quite a few different scripts to no avail.
    Thanks for any assistance.
    jeannie

  • Analyzer calculation of sum without not available data fields

    Hi,<BR><BR>I use Hyperion Analyzer 6.1.1.00206. I would like to calculate sum of some members.<BR><BR>So I did the following Analysis Tools | Calculations and selected the sum of desired members.<BR><BR>But if data field does not have a value (no data = n/a) then sum of members is also n/a (no data)!<BR><BR>Is there a way to specify the "not available" is treated as 0?<BR><BR>Thanks,<BR>Grofaty<BR>

    Yes, Click on File, then Preferences then DEFAULT FORMATTING TAB and at the bottom it gives you the option of selecting <BR>"REPLACE MISSING DATA WITH" Zero or text. I believe yours is set on text "n/a". Just select "zero" button and click ok. This should solve the problem. Best of luck<BR><BR>Benjamin M Hoffmeyer<BR>Marketing Analyst SSP CIRCLE K

  • Lock Automatic Date Field after Submit

    I have a form that generates the current date when the form is open.  Once the user complete the form I have a submit button that will flatten the file and submit the completed PDF. All this works great. 
    The challenge I have is even though the form is flattened, when a user opens the flattened PDF in a PDF Reader the date displays the current date.  Is there a way to set this field to update only once when the form is initially opened?
    I am currently using the following function to generate the date in the field.
    var f = this.getField("OpenDate");
    f.value = util.printd("yyyy/mm/dd", new Date());
    I am running Adobe Acrobat X Pro.
    Regards,
    Robert

    To test the form, you need to close the saved form and reopen it. Because the field is empty it should populate. If you save, close the form, and reopen the form the date should not change.
    Note the PDF needs to be opened before a document level function will execute and it will only execute once.
    If you want the form to work for others, it needs to be saved with  the date field empty because when the form is opened and the document level script runs it will only populate an empty date field and if the field has any non-null value in it the field will not update.
    For testing you could change the script to include an alert to tell you if the date field is being updated or not.
    A "flattened" PDF has no form fields.

  • Calculating a date field

    Hi Everyone,
    In my input form, i have 2 date fields (effective date and end date).  I want the end date to be defaulted to 1 year after the effective date.
    How do i accomplish this??
    Thanks
    Arnil

    Hi,
    use the formula in Default value of End date field:DADD(@Effectivedate,1,'Y').
    General formula:DADD(d,n,dateunits).
    Regards,
    Govindu

  • Replacement for FormCalc Date2Num Date Field Calculations in Mobile Forms?

    I have a number of forms that use the FormCalc Date2Num function. According to the Adobe documentation this function is not supported in mobile forms. If I were doing pure html5 forms I would use a JavaScript library to use a similar function. What's the best practice for handing Date2Num in Mobile Forms?

    What's the formatted value of your date field?

  • No data fields are available in the OLAP cube

    i was able to access data in Excel yesterday, but now all the cubes that i have created cannot be accessed by Excel any more and after authenticating and selecting the cell for the pivot table i get this error:
    No data fields are available in the OLAP cube
    i just hope this is some process in HANA that needs restarting and not some endemic MDX problem. if so, where do i look?
    has anyone seen this?
    BTW, shouldn't there be a single log on for the connection? i have to enter credentials twice: 1 when creating the connection and 2 when opening the pivot table.

    something/someone has locked my userid when i was recreating the steps in Excel (i don't think i have tried 'wrong' passwords, but i did try a ['wrong' user|http://misiorek.com/h/GMSnap206%202011-11-27.jpg]
    Here are the steps:
    1. Open [Excel|http://misiorek.com/h/GMSnap202%202011-11-27.jpg].
    2. Enter [connections|http://misiorek.com/h/GMSnap203%202011-11-27.jpg].
    3. Select [HANA cube|http://misiorek.com/h/GMSnap204%202011-11-27.jpg].
    4. Select [Pivot cell|http://misiorek.com/h/GMSnap205%202011-11-27.jpg].
    5. Enter credentials (see above).
    I'm also not sure why I see these security messages:
    [locked|http://misiorek.com/h/GMSnap207%202011-11-27.jpg], Microsoft [warning|http://misiorek.com/h/GMSnap208%202011-11-27.jpg], HANA [warning|http://misiorek.com/h/GMSnap209%202011-11-27.jpg], HANA db [warning|http://misiorek.com/h/GMSnap210%202011-11-27.jpg]

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • SPl G/L posting Due on Date field should mandatory field .

    Hi ,
    while posting special G/l code 'G', (Advances from vendor with posting Key-29 ) I need  Due on Field as Mondatory field, (Baseline date for due date calculation
    Date to which the periods for the cash discount deadline and the due date for net payment refer. This is the case for line items in open item accounts.) it is giving other Spl G/l code except this code, it is in suppress mode. anybody can help me how get this field as reqd.( I have given same field status group and same reconciliation account also, for which I am getting it is a mondatory field eventhough it is not showing)
    Regards,
    SYReddy.

    1) use validation :  OB28
    2) tcode OB41
    A.

  • How do I populate my date fields placed on Master Page for multiple pages?

    I have a dynamic form with flowing fields. I inserted date fields using the Master Pages tab within Adobe LiveCycle Designer ES2, Windows 7 OS. I have only 1 Master Page. Everything on the form is working properly, except when I have multiple pages, the date fields are blank on all but the first page. One of the date fields has javascript in the exit event to calculate the second date field. I can manually edit the subsequent page(s) date fields, but I don't want the end user to have to do that. I want the date fields on the new pages to equal the date fields on the first pages. Below is my output with notes to provide a visualization of what I'm looking for.
    Many thanks in advance for anyone who can help me with this issue!
    Caroline

    Hey Mandy,
    Yes, both date fields are on the Master Page. The first one is set to "User entered - Required" and the second to "Calculated - User Can Override"
    And that's right, I used your script to calculate the second date field. The only thing I changed was the field name, and used 6 days instead since I wanted the calendar days to only run a full week, like start on a Monday and end on Sunday.
    Thx,
    C

  • Creating a Calendar View using alternative date fields

    I have a Sharepoint 2007 calendar list that includes the standard Start and End Date fields.  I also have "Suggested Start Date" and "Suggested End Date" fields that are utilized by users to recommend the Start and End Dates for
    the event.
    I can create a Calendar view that displays the events according to the Start and End dates.
    I cannot create a Calendar view that displays the events according to the Suggested Start and Suggested End date fields.
    In practice, all items are not displayed on this second calendar view that should be displayed even though you can choose these fields as Time Interval values when establishing the calendar.
    Is there a way to create a Calendar View that will use date fields other than the default Start and End date fields?
    Thanks,
    Chris Mang>> JDA Software Group, Inc.

    Hello,
    It seems problem with time value. Have you included time value in custom datatime column wile creating? What happens when you select "date only" from column settings?
    You can also try below suggestion to include "IncludeTimeValue" parameter in CAMl query by designer:
    http://stackoverflow.com/questions/18362853/how-do-i-filter-by-today-and-time-in-sharepoint-list-view
    OR else create two more calculated column and save date only in those columns then filter by them.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • GRR2 Report Painter - is it possible to see revenue by customer?

    Greetings I have a requirement where I need to compare customer forecast values (manually entered) vs actual customer revenue. Is something like this possible? I am attempting this thru a CO-CCA report. At GRR2 I looked at library 1VK (table CCSS). T

  • Multiple art boards disappear on reopening doc

    Using a Dell PC, Illustrator CS4, Windows XP Pro. I had a one art board document.  To create three additional art boards, I ALT/SHIFT & dragged the initial board.  After finishing my work, I closed the document.  On reopening the doc, I find all of m

  • Dynamic Page in Scripts

    Hi, How can we create dynamic pages(new page) in Scripts? ie., like I am selecting a new company code, while doing this I need a page to be created dynamically. Regards, Renjith MIchael.

  • Adobe Viewer Bug

    It looks like there is still a bug in the newest Adobe Viewer. If you completely close the app Adobe Viewer on an ipad (that means no background-running) you will lose all the downloaded issus. But if you go to remove issues in the app it still shows

  • Has anyone accessed their Virgin Media Webspace using an iPad ?

    I originally set up my website on a PC - http://homepage.ntlworld.com/g.steeper. I now have an iPad and would like to use it tomaccess and edit my web space. I have tried with the iPad App. 'codeanywhere' with little success. Is anyone out there able