Formcalc script help!

My timesheet is a form created in livecycle es and the form looks similar to the one below my problem is in formcalc I cant figure out a way to calculate the time correctly for me what I want it to do is if I enter 12 in the sunday block 10 should then be added to straight time and 2 should be added to overtime and then if I add 12 in the monday block Straight time shoud then be 20 and overtime would then be 4 and it would continue to add the overtime of any value over 10 entered in any of the other blocks as well. and
basically any day worked over 10 is overtime and the rest is straight time even I did not work a full 40 any help would be appreciated Thanks!
sun
mon
tue
wed
thu
fri
sat
straight time
overtime

I don't know if this helps but here is the script I wrote and it will work in wksunhrs1 if i put in 12 it puts 10 in wktlst1 and 2 in wktlrh1 but if I put 12 in the rest of the objects like wtlmonhrs it does not change wktlrh1 or wkmonhrs1 I need it to keep adding what it moves to wktlrh1 and wktlrh1 but it wont. any information would be very helpful Thanks!
topmostSubform.Page1.WKTLST1::calculate - (FormCalc, client)
var
wktlst1 = WKSUNHRS1+WKMONHRS1+WKTUEHRS1+WKWEDHRS1+WKTHUHRS1+WKFRIHRS1
if (WKSUNHRS1 > 10) then
WKTLST1= 10 WKTLRH1= WKSUNHRS1 - 10endif
if (WKMONHRS1 > 10) then
WKTLST1= 10 WKTLRH1= WKMONHRS1 - 10endif
if (WKTUEHRS1 > 10) then
WKTLST1= 10 WKTLRH1=WKTUEHRS1 - 10endif
if (WKWEDHRS1 > 10) then
WKTLST1= 10WKTLRH1=WKWEDHRS1 - 10endif
if (WKTHUHRS1 > 10)
then
WKTLST1= 10WKTLRH1=WKTHUHRS1 - 10endif
if (WKFRIHRS1 > 10) then
WKTLST1= 10 WKTLRH1=WKFRIHRS1 - 10
endif

Similar Messages

  • Need help with a FormCalc scripting

    I am new to FormCalc and need some help. I am creating an interactive PDF in which I need a FormCalc script code for the following situation. I need to have a check box initate a script in another field. For example; I have one numeric field for quanity ordered (user input) and a check box for an optional add-on. Once the check box for the add-on is selected; I need a third field to reflect the price of the add-on * the numeric value in the quanity field.
    ProductPrice     Product Quanity          Add-On                        Total Cost
    Pd1                    2                              ($300) check box            Product Price * Product Quanity  + Add-On Price (if clicked) * Product Quanity
    Can anyone help?

    That was helpful but I still can't see to get it work. In the form I am creating The field that needs to autocalc. is to be triggered by the user clicking an add-on box. I have the add-on checkbox values set as 1=check and 0=unchecked. The idea is that when the that box is checked, the "ItemTotal" field to be calculated will be triggered to then take the Quanity field and mulitply by 300. Below is the script I tried to use and the error message returned when the Add-on box is checked.
    if (Add-onBoxName == 1) then
         Quantity * 300
    Error message in Adobe Reader when box is checked:
    Script failed (language is formcalc, context is xfa[0].form[0].topmostSubform[0].Page2[0].Add-onCheckBox[0])
    script=if (Add-onCheckBox = = 1) then
    ItemTotal = Quantity * 300
    Error: syntax error near token '300' on line 4, column 0.

  • Hiding Pages in ADOBE form using formcalc scripting.

    Hi Experts,
    I am new to ADOBE form and currently working on invoice print output. (NOT an  Interactive adobe form)
    My requirement is
    i wanted to print one main page and 5  different annexures(anexures are having different layouts so is in diff forms and contained in diff pages)
    Deppending on 'Oreder reason' (made as global variable)  , i need to select appropriate annexure and print
    main page and any one of the annexure.
    so i should hide all other annexure, to achive this i used formcalc scripting.
    i tried hiding annexure 2 by following code,
    data.Annexure2::ready:form - (FormCalc, client)
    if ( data.G_F_ORDER_REASON.rawValue == "ANX" )
    then $.presence = "hidden"
    endif
    i have passed value 'ANX' to this , i could see the value of order reason printed on page Annexure2 but it is not executing (getting in to if condition) condition and not hiding the page ...
    Experts please help me...
    this way i have to hide 4 other annexures...please help me or give me some other option to achive this.
    thanks and regards
    varun
    Edited by: skyblue on Aug 6, 2011 3:30 PM

    coding Formcalc is a pain.
    But you're doing the right thing by passing in a variable and hiding based on the content of it.
    Here's an example of where I'm hiding a subform on a page.
      if ( main_sf2.charter_only.CHARTER_DOC.rawValue eq "X" ) then
       main_sf2.pts_sf.presence = "visible"
      else
       main_sf2.pts_sf.presence = "hidden"
    endif
    Looks like your code is similar - try changing
    ( data.G_F_ORDER_REASON.rawValue == "ANX" )  to
    ( data.G_F_ORDER_REASON.rawValue  eq "ANX" )
    or instead of $.presence = "hidden"  fully qualify the name of your page to  data.Annexure2.presence = "hidden"

  • Using context variable in formcalc scripting language.

    Hi all,
             I wanted to know if it is possible to use context variables in formcalc. I wanted to use those variables in "if else" condition in formcalc scripting language. Please post the sample code also as i am new to adobe forms.
    Regards,
    Vinod

    Hi ,
    Each variable define in the context can be used on the layout of the form and/or in script linked to fields.
    This can be done in formcalc or in javascript language , without any problem . You have only to acess the correct variable in the script.
    For getting variable in a script you must define the complete name of the variable, example "Myform.Header.Data.Myvariable" get access to variable MyVariable define in the context under nodes Header/Data .
    Hope it's help you
    regards.

  • Error in FormCalc Script of Adobe Interactive Forms

    Hi,
    We created certain <b>Custom I.S.R. Scenarios</b> and attached them to Workflows. So in these regards, we had already created the needed forms in Adobe Interactive Forms Transaction(SFP) and launched the Scenario successfully in Enterprise Portal.
    But we have a couple of requirements like during <b>Create</b> mode of the form, I should be able to modify certain contents of the form, and during the <b>Change</b> mode of the form, I should be able to modify certain other fields of the form. So I had opted for <i>FormCalc</i> Scripting in these regards.
    I used the following code...
    if($record.CONTROL_PARAM.ISR_MODE == "CHANGE")     
    then
         this.access = "readOnly"
    else
         this.access = ""
    endif
    Well, I used the same script in two of my forms. For one form, it's working very perfect. But for other form, it's giving the following error..
    Error : accessor '$record.CONTROL_PARAM.ISR_MODE' is unknown.
    I am very much mazed, why the same code behaves in 2 ways in two different forms.
    So can anyone help me in these regards?
    Regards,
    Raja Sekhar

    Hi,
    I solved the problem by applying alternate solution.
    I used Java Script instead of FormCalc Script.
    That cleared my errors.
    Regards,
    <b><i>Raja Sekhar</i></b>

  • FormCalc script language for calculating PV

    Greetings,
    I need to calculate a Present Value (PV) in a table for rent. I can not (after many, many tries) come up with the formcalc script language that mirrors the Excel formula my boss has used in a spreadsheet.
    I know the 'formula' is PV(n1, n2, n3), but that is apparently NOT what needs to be written as the script. Do I use ".rawValue" in writing this out? Do I use the ctrl+applicable cell in choosing a segment?
    My first example of needing to calculate this  is having a total amount for a year's rent, a discount rate of [user entered, example would be 5%], and a period of the term year minus 1 (so year 1 would be 0 or not used; year 2 would be 1, year 3 would be 2). This is what the Excel formula relates to, although it uses a negative (minus) in front of the year's rent amount.
    Writing PV(yramount,  discountrate, yr-1) doesn't do anything to create the answer.
    Do I write ...    $.rawValue = PV(yramount.rawValue, discountrate.rawValue, yr-1.rawValue) or ....
    I can't figure it out (and I've tried this formula every way I can imagine and I'm getting nowhere).
    I am also going to be calculating the Present Value of Total Lease Obligations each year (which is another oddity of  discountrate, yr-1, negative TotalLeaseobligation).
    Once I get 'row 1' calculating, the following rows will be added based on the number of term years, and the calculating will include percentage increases over the prior year along the way. I can't wait :-O
    If someone could please help me crack the "actually USING in a form the formula for Present Value)", I will be so very grateful. It is decidedly beyond my sub-novice attempts.
    Thank you!
    Shu

    Oh, my, thank you so much! It is truly baffling to me. I’ve attached my efforts for what it’s worth. I try to explain more below.
    I was basing my ‘assumption’ on this ‘formcalc information’ – but obviously I couldn’t do anything with it as it is too cryptic for a beginner.
    Here is the Excel formula used in the current spreadsheet:
    = PV($B$22,B$26,,-C28
    Where B22 is the Discount rate (e.g. 5%)
    B26 is a number representing the year number of the prior year in the Term (e.g., the first year pulls a blank cell, the 2nd year pulls “1”, the 3rd year pulls “2”)
    C28 is the Base Rent amount for the year being calculated, but shown as a negative (?)  [That number is calculated as a $/square foot * number of square feet]
    In my LCD form, I’m calculating in a table in which there is a header row, a footer row, currently 2 body rows, and I’m trying to get all the values to calculate based on information “provided above” in the form. The first challenge is the first row and I’ve gotten everything to ‘work’ except the “Total Base Rent(PV)” and the “Total Lease Obligation(PV)” the 3rd PV value is an arithmetic calculation between these results.
    Current Row 1 formulas:
    Base Rent: $.rawValue = NF3BaseRentPersf.rawValue * NF1SquareFootage.rawValue
    TI Costs: $.rawValue = NF14AnnDebtServTotal.rawValue
    Furniture Fixtures Equipment: $.rawValue = NF14FFETotal.rawValue
    Move Costs:  $.rawValue = NF14MoveCostsTotal.rawValue
    Total Lease Obligations: $.rawValue = Cell2.rawValue + Cell3.rawValue + Cell4.rawValue + Cell5.rawValue
    Common Area Costs: $.rawValue = NF4OpExPersf.rawValue * NF1SquareFootage.rawValue
    Utilities: $.rawValue = NF5UtilPersf.rawValue * NF1SquareFootage.rawValue
    Other Expenses: $.rawValue = NF6OtherPersf.rawValue * NF1SquareFootage.rawValue
    Total Operating Expenses: $.rawValue = Cell7.rawValue + Cell8.rawValue + Cell9.rawValue
    TOTAL Estimated Costs: $.rawValue = Cell6.rawValue + Cell10.rawValue
    Total Base Rent (PV): ______________________?
    Total TI & Other Costs (PV): $.rawValue = Cell14.rawValue - Cell12.rawValue
    Total Lease Obligation (PV): _______________________ ? (THIS -> doesn't work: $.rawValue = PV(NF15DiscountRate.rawValue,, -Cell6.rawValue)
    I'm sorry for being so naive with all this. We are gobsmacked (in a great way) with the possibilities of LCD-- IF I can just get the hang of this stuff.
    Here's the hierarchy for the table:
    and these are related hierarchy references (you can tell I haven't quite gotten the naming of objects down very well).
    AND my NEXT challenges: I am trying to make this a ?repeating row table? And will attempt to add an 'add row' button that will allow the addition of a row reflecting the number of years in the proposed term (from 1-10, usually). So I need the amount to sum in the footer as well as the couple of sums within each row. Starting with the 2nd year, the Base Rent and Operating Expenses amounts will be a factor of the prior year's amount * the applicable Escalation % (Base Rent Escalation or Estimated Annual Expenses Escalation) -- which is why I figured I had to go on and include the 2nd row to put those formulas therein. I am ASSUMING that when I enerate subsequent rows with the "Add Row" button (crossing fingers!) that the formulas will duplicate and the correct amounts will be reflected, including the right totals -- although for a 1-year term I'll need to figure out how to 'delete row' the 2nd row so the totals aren't ka-flooey.
    I am extremely grateful for your help in any way you can share. This is a lot of fun -- but I just don't speak the LCD language yet. Thus I flounder.
    Appreciatively,
    Shu
    p.s. I am not sure how to provide a copy of my actual form-in-progress. Much of what I'd written in reply was stripped out so I've come back in to edit and add what I'm able.Thanks again!

  • FormCalc/Script query?

    Start Time
    End Time
    Mode of Transport
    Journey Time
    HH:MM
    HH:MM
    Drop Down List
    Auto calculated on start/end times
    Total Time Traveling
    Sum of Journey Times
    Mode of Transport
    Total Time Journey Time
    Drop Down List
    I have created an interactive form which requires members of the general public to fill out a travel diary. I have got all the calculations to work except the bottom table. I'm trying to figure out which formcalc scripts to use to give a total time for each mode of transport, based on the users choice. For example, if the user want's to see how many mins they have cycled this week, they pick cycling from the drop down list on the bottom table and then in the total journey time it tells them how many mins they have cycled that week.

    Hi,
    I am all for learning and hope that this returned form helps. But a little annoyed that Managers do not "appear" be place a value on it.
    https://acrobat.com/#d=HJIBeWz3ZjvcBZjsSW-Vrw
    I have sorted out the first two pages, in how I believe it would be best to approach the problem:
    I have deleted the rows and just kept one row which is repeatable (see Object > Binding palette). This is easier to maintain, as all of the script is in one row. The row is then set to have a minimum of 10 occurrences.
    I have also included tool tips in the fields for accessibility. Local Authority and all.
    You should name objects based on their role. This makes it much easier to script against. See here: http://assure.ly/mxZO9T.
    I have inserted a page and table for the summary. I have taken an approach where all of the categories would be visible and the corresponding times. I have also includes a bar chart. You could colour each bar based on the greenness of the mode of transport.
    You need to look at the script in the summary times. This loops through the first two pages AND loops through each of the 10 rows in each of these tables.
    Looping script for anyone interested:
    // Set up some variables
    var vTime = 0;
    var currentRow;
    // Calculate a summary for car
    for (var i=3; i<5; i++) // work through the first two pages
         for (var j=0; j<10; j++) // work through the ten rows in each page
              currentRow = xfa.resolveNode("Page" + i + ".Table1.Row1[" + j + "]");
              if (currentRow.modeTransport.rawValue == "Car")
                   vTime = vTime + currentRow.journeyTime.rawValue;
    // Set summary journey time
    this.rawValue = vTime / 60;
    Hopefully your manager will see value!
    Niall

  • FormCalc Script problem

    Hi,
    We have a couple of problems with FormCalc Script.
    We have different RADIO BUTTON Groups which needs to be ENABLED during CREATE mode and needs to be disabled in other modes.
    So, we have attached a FormCalc Script as shown below.
    <i>if($record.CONTROL_PARAM.ISR_MODE == "CREATE")
    then
         this.access = ""
    else
         this.access = "readOnly"
    endif</i>
    And when we test our Adobe Form our SCRIPT is working only for one RADIOBUTTON group. But it is not working for other RADIOBUTTON groups.
    I dont understand why it is behaving this way.
    I have attached the same coding for all the groups in the same event - INITIALIZE. Still I am getting this problem.
    Can anyone help me out.
    Regards,
    <i><b>Raja Sekhar</b></i>

    Hi Juergen,
    Thanks for the patient reply.
    Sorry,I lost my patientence with these RADIOBUTTONS Problem. That's why I am not able to reply you promptly.
    Anyhow's I checked the below mentioned stuff and here are my observations.
    1) I have added the MESSAGE BOX and checked the ISR_MODE value and this.access value also. During the creation of form <i>ISR_MODE</i> value is <b>CREATE</b> and <i>this.access</i> is <b>OPEN</b>.
    And during the Approval at first level supervisor, the value of <i>ISR_MODE</i> is <b>CHANGE</b> and <i>this.access</i> is <b>readOnly</b>.
    The values are getting populated as expected.
    2)Coming to the SCRIPT INTERFERENCE, this is the only EVENT defined for this field and there is no script defined at the FORM LEVEL.
    Regards,
    <i><b>Raja Sekhar</b></i>

  • Regarding FormCalc Scripting for Adobe Print Forms

    Hi Friends
       I am working on Adobe Print Forms.
    I wish to write some FormCalc Scripting  in form on date field.
    I want to know the meaning for the below scripring :
    $.format.picture = DateFmt(2, $.locale);
    $.ui.picture = DateFmt(2, $.locale);
    $.assist.toolTip.oneOfChild.value = LocalDateFmt(2, $.locale);
    Can anyone please explain me the above scripting in detail.
    Points are assured for useful answers.
    Regards,
    Sree

    Hi Susy,
    This is a problem with the transaction SPF. The Adobe form painter i.e. SPF transaction is still not very stable.
    I had faced the same issue when I was working with SAP labs for developing the SAP standard reports.
    Hope this problem is resolved in future versions. But currently there is no solution as such to it.
    I think its better that you create the form yourself rather than uploading the PDF document.
    Lokesh
    Pls. reward appropriate points

  • Adobe Forms - FormCalc Scripting Question for Image Control

    Hi All,
    I have three images on my master page. I have a hidden text field. Based on a certain value within this text field I need to turn off Imagefield B and ImageField C and Leave ImageField A visible.
    I know this can be done via FormCalc scripting.
    My Questions:
    Which event shoudl I put the script in? I was thinking the textfield initialize event.
    What would be the EXACT syntax to turn turn image fields on or off?
    Please inform if know.
    Regards,
    Salil

    I solved it now, just changing the FormCalc expression.
    Instead of using the expression:
    this.value.image.href = xfa.resolveNode(this.value.image.href).value;
    I used this:
    this.value.image.href = xfa.record.Images.URL;
    The URL value of Image Field, in this case is:
    <b>$record.Images[*].URL</b>
    And, to finish, I needed to add a Text Field bounded to  <b>$record.Imagens[*].URL</b>, case else the image doesn't appear.
    That's it!

  • FormCalc script is not executed

    Hi everybody,
    I've developped a Pdf forms with FormCalc Script.
    This script does works in the preview designer of SFP transaction but when i try to run the pdf forms through a specific program, the script is not executed.
    Do you have any idea ?
    The pdf is a ZCI layout.
    My SAP platform is ECC 6.0

    Brice,
    What is the type of form you are developing ? Interactive or Print.
    My guess you be creating a Print form where dynamic scripting does not work.
    Alternatively put following line of code in the script to see if the control is transferred to your event or not.
    $host.messageBox("Inside event")
    Chintan

  • Gallery script help, please

    Gallery script help, please
    Hello,
    I'm new to actionscript in general, I do know a little...
    I foung a gallery script, modified many things, the images
    open fine, everything is working, but here's the thing:
    the gallery is in 3 sections, red, blue and yellow.
    I would like to know how, what, and where to put a script so
    that if a "the small red image #1" is clicked, I can load any sort
    of a movie on top of the "the BIG red image #1" or #2 or 3 and so
    on...same goes for the blue and yellow...
    If I figured things correctly on my own...the small thumbnail
    images of the gallery are not buttons, that's why I can't attach a
    movie (let's say) to them...but it is all written in script, using
    the horizontal and vertical position of the mouse to open the large
    images of the gallery...
    So, I don't know how to figure things out, to attach a
    specific movie to a specific thumbnail...
    p.s.: I think the script that controls the gallery is in
    symbol 120
    I really would appreciate the help
    Merry Christmas in advance to everyone
    Sandra
    here are all the files...
    http://www.gentro.ca/sandra_test.zip

    There's a great tutorial on kirupa...
    click
    here for link

  • Firefox not responding, freezes, sometimes responds after a few minutes, other times a pop-up appears asking if I want to stop script - help please

    firefox not responding, freezes, sometimes responds after a few minutes, other times a pop-up appears asking if I want to stop script - help please

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Help needed with FormCalc scripting in LiveCylce 8.0

    I am new to the whole form design functionality in Adobe.  I have a form that I have created that has multiple fields calculating off each other.  I have managed to get all the fields to calculate correctly, but I'm having trouble figuring out the correct formula for one field.
    After/during field 3 calculation, I need the value to return 1000.00 if greater than 1000.00 else return Field 3 amount.
    Formula
    Current
    Calculations
    Correct Calculation
    Example 1
    Correct Calculation
    Example 2
    Field 1 - Annual Salary (User enters)
    100000.00
    100000.00
    30000.00
    Field 2 - Weekly Salary (calculation is: field 1 / 52)
    1923.07
    1923.07
    576.92
    Field 3 - Benefit Maximum (calculation is: field 2 * .60)
    1153.84
    1000.00
    346.15
    Field 4 - Hidden Field (calculation is: field 3 - 100.00)
    1053.84
    900.00
    246.15
    Field 5 - Monthly Cost (calculation is: field 4 * .025)
    26.34
    22.50
    6.15
    Field 6 - Pay Period Cost (calculation is: field 5 * 12 / 26)
    12.15
    10.38
    2.83
    After/during field 3 calculation, I need the value to return 1000.00 if greater than 1000.00 else return Field 3 amount.
    Any suggestions on how to get this to work?  Tried setting this up using Java Scipt, but when I do, the fields dissapear alltogether.

    Hi,
    You have to add the attribute to each item props, try this:
    customerExitBeforeIpcItemsCreate(ItemPriceRequest[] iR, IPCItemProperties[] itemProps) {
    for (int i = 0; i < itemProps.length; i++) {
       Map theMap = itemProps<i>.getItemAttributes();
       theMap.put(("ZZITM_USAGE", "Z010");
       itemProps<i>.setItemAttributes(theMap);
    Regards,
    Ranko

  • Error in simple FormCalc Script

    Hi
    The following script in a checkbox change event returns the error below:
    Z_Lso_BookingData.#subform[0].Subform6.CheckBox1::change - (FormCalc, client) -
    if ( $.value == " 0" ) then
         Subform2.presence = "invisible"
    else
         Subform2.presence = "visible"
    endif
    Error: invalid property get operation; value doesn't have default property.
    Any suggestions what could be wrong? Thanks for responding.
    René Morel

    Hi,
    If I get your problem then you are trying to make the check box visible and invisible based on some parameter.am I right then I would like to suggest to follow the following code in the script editor:
    And if you want to make some text hidden/invisible based on some RFC parameter then try out this code:
    Else if you are comparing on the basis that if the parameter returned is null then this would work.
    In the script Editor try this script on the field in with the following
    Show: initialize
    Language: formcalc.
    Run at: Client
    If ( $.isNull ) then
    $.presence = "hidden"
    endif
    Or try out this  code
    Write this code on superior subform.
    If ( $.<FIELD>.isNull ) then
    $.presence = "hidden"
    endif
    Provided the subform should be in flowcontent.
    If you still see any problems let me know if you require any further help.
    Thanks,
    kris

Maybe you are looking for

  • InDesign CS5.5 crashes as soon as I open document

    Hi All So when I open this particular document it crashes InDesign CS5.5 insantly. Could it just be the size of the file? I've never had it happen and I had the client send this file over twice now. I rather just find out what the heck it is. Below i

  • Problem when installing oracle 9i

    hi all, After I put oracle 9i CD into my CD ROM, it was no reaction. Also, I double click 9i setup icon, it was no reaction too. I am sure the CD ROM and the CD's are fine. Do anyone knows what is happening? Thanks. Amy

  • Substitution to give a discount to vendor on MIRO - BSEG-ZBD1P

    Hi people. We are having a issue trying to add a discount on field bseg-zbd1p. We have added a substitution rule that executes on MIRO, for a certain material we want to give a discount to vendor, but it is not working. We try to change the field bse

  • I can't move exactly the objects

    I have Indesign CS5, I have turned off all the snap guides, but i still have the problem, that the program snap the objects in one place to another, so i cant put exactly each other rectangles. Here is a pic demonstrating the problem. Here i wanted t

  • How to do a specific report

    Hello! I have an assignment to do. In my dashboard page I have a time prompt with this format (25/06/2011) and I want to do a chart with axis X with all days of month of my prompt. I mean, if user select in page prompt (25/06/2011) I should see in my