Need help with Javascript calculation hidden values.

See the problem down below. Thank you.

Calc_Problem.jpg

This line is incorrect:

(TotalValB - CostBasB) = this.getField("NV_B").value;

Replace with:

this.getField("NV_B").value = (TotalValB - CostBasB);

Tags: Acrobat

Similar Questions

  • Need help with the calculation on the invoice form

    I've never used Adobe Acrobat and know nothing about JavaScript.  I am creating a form of invoice.  I have it almost complete but can't do 2 things resolved.

    1. If a line on the invoice is not used, I need the amount column empty, not 0.00.

    2. I need to add 2 totals (parts and labor) and calculate the sales tax on the total of these 2 items.

    Everything I read is way over my head. I'm an accountant, not a programmer!

    Thank you

    # 1, you can configure a custom JavaScript validate it is simply:

    // Custom Validate JavaScript
    if (+event.value === 0) event.value = "";
    

    # 2, use the simplified notation next to the calculation field:

    Parts * work * 0.085

    Replace 0.085 with tax rate that you use

  • Need help with Javascript for Acrobat 9 Pro

    Hello

    I have created a PDF form in Adobe Acrobat 9 of Profession.  Not having not much experience with Javascript, I found this forum very helpful and have many examples of script used to other issues, I had.  I was hoping that someone could help me with the following script, I tried many variations, cannot operate.

    var ratio = this.getField("ratio").value
    concentration of var = this.getField("concentration").value
    var result = this.getField("result").value
    If (ratio.value > = 50.00)
    {result.value = 'PASS' ;}
    If (ratio.value".value > = 40.00)
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 49,25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==61) & & (ratio.value > = 39.25))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 48.50))
    {result.value = 'PASS' ;}
    If ((concentration.value ==62) & & (ratio.value > = 38.50))
    {result.value = 'PASS' ;}
    on the other
    {result.value = "FAIL" ;}

    It's just a piece of code, concentration values run from 61 to 99 and the value of the ratio varies for each value of the concentration, there is a high ratio and a low ratio.  The result of this field to complete the field of results with a SUCCESS or a FAILURE.  This isn't working... any help is greatly appreciated!

    If this script is attached to the Calculate of the "result" field event, if I understand correctly the logicm code should be something like:

    // Get a reference to the ratio field
    var ratio = this.getField("ratio");
    
    // Get a reference to the concentration field
    var concentration = this.getField("concentration"); 
    
    // Default
    var res = "FAIL";
    
    if (ratio.value >= 40.00) {
        res = 'PASS';
    }
    
    if ((concentration.value == 61) && (ratio.value >= 39.25)) {
        res = 'PASS';
    }
    
    if ((concentration.value == 62) && (ratio.value >= 38.50)) {
        res ='PASS';
    }
    
    // Set this field's value
    event.value = res;
    

    If the code is placed elsewhere, you must indicate the location.

  • Need help with Javascript to get the value of standard report column

    Hi all

    Apex 3.1 version

    I have a query SQL (editable report) region where I need to do validations using a process of OnDemand and javascript. For this posting, I need to use the serial number and id of this same report line item. The function is called when the serial number is changed. I can get the serial number easily because it is a text field, however, the item id is a standard report column (which actually a text field or hidden gives me a checksum error, long story). How can I get the value of the standard report column to set the value of an element of the Application to use in my process of application as well as the serial number? Here is my code below.
    <script>
    
    function f_ValidateSerial(pThis)
    {
        
      // The row in the table
    
      var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
    
        //alert('Row is '+vRow);
    
    
      // Display the serial number
        //alert('The Serial Number is '+html_GetElement('f21_'+vRow).value);
    
      
     var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=ValidateSerial',0);
     get.add('F101_SERIAL_NUMBER',html_GetElement('f21_'+vRow).value);
     get.add('F101_INVENTORY_ITEM_ID',+html_GetElement(?????+vRow).value);   // Here's where I need to get the item id to set application item!!
     
     gReturn = get.get();
     
    if (gReturn)
        { 
          alert(gReturn);
        }
     
      if(gReturn)
        { 
          html_GetElement('f21_'+vRow).value = '';
        }
               
    }
    </script>

    Hello

    Ok

    Item ID is standard report column.
    If you enter this Expression HTML column

    #ITEM_ID#
    

    I guess that the substitution of column item Id is #ITEM_ID #.

    Now, you have hidden input form that is not submitted.
    Then in JavaScript

    get.add('F101_INVENTORY_ITEM_ID',+html_GetElement('item_id_'+Number(vRow)).value);
    

    Kind regards
    Jari

  • Need help with this calculation

    Hi members,

    Im trying to do some logical columns for calculations. It is a very simple calculation, but I can't seem to make it work in the repository.
    The data upon which I make eyes of calculation as follows.

    Issue Nr. | Question | Meet Nr. | Response | Answers (number of responses)
    1. | Job satisfaction | 1. | Very good | 8
    1. | Job satisfaction | 2 | Good | 2
    1. | Job satisfaction | 3 | Bad | 5
    1. | Job satisfaction | 4 | Very bad. 0

    It is an example of the data. Now, I want to make a logical column to calculate the 'happiness factor '. The formula looks like:

    (Very good + good) / (very good + good + good + bad) * 100 = happiness

    So it would be 10 / 15 * 100 = 66.66.

    Very simple, but I have no idea on how to accomplish this formula in the repository. What I was aiming for in my head, it was something like:

    Select the answers where [answer] Nr. (3,4) / select responses where [answer]. Nr in (1,2) * 100 = :)


    Does anyone know how to do this in the repositroy? It would be highly appreciated.

    Erik.

    Hello

    This happens when we don't know all the facts and we create our scenarios and responses only what we know...

    Now you can do if you do not use 'no opinion' or 'Empty response' in our 'answers' but again to tuition assistance box...

    'All answers worth calculation' =
    case when answer in ('list of what answers I want to aggregate', ((Very) Happy... (Very) Unhappy))
           then 'my new All answers'
           else 'answers I need to ignore'
    end
    

    and our dimmnesion should look like:

    'Type of survey' -> 'Question' -> 'All answers worth calculation' -> Happiness -> Answer
    

    in this case the levels should be no to the 'Question' but to our new "answers a calculation value..."

    So, for an issue with 21 responses it is only 6 entries ((very) happy, (very) unfortunate, Blank, do not know)
    A separate account solves your problem...

    In addition, in your last post I don't understand how you can sum UP non-numerical data (Happy/headaches)
    No aggregate data not digital (Happy/headaches)
    you aggregate your fact group by happiness(Happy/Upset)

    sum ('Table'.) ("' #Answers" by BOX WHEN in Answer (' very good ',' good ') THEN ELSE 'Evils' END 'Happy' *) *.

    I think you've got the ideea of how play with several groups on the same Assembly and how to manipulate BI...
    All you have to do is to play with your data to add or exclude what you need
    If the data is not there you want you allways can create a view in the database or in physical layer so it can help you more.
    On another thing... There is a way to filter data at the logical level at the source of the logical table, the content tab, where clause. Don't say you use here, just give it a shot

    Best regards and fun of it
    Nicolae

  • Need help with the accumulation of value.

    Hello world

    My version of DB is

    BANNER

    ----------------------------------------------------------------

    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi

    PL/SQL Release 10.2.0.1.0 - Production

    CORE 10.2.0.1.0 Production

    AMT for Linux: Version 10.2.0.1.0 - Production

    NLSRTL Version 10.2.0.1.0 - Production

    Please take a look at the structure of the table, some examples of values, query, and result and help out me.

    create table ppdev_own.product

    (

    number of product_id,

    sold_date date null not activate.

    activate the sold_quantity number not null,

    constraint product_pk primary key (product_id, sold_date, sold_quantity) activation

    ) ;

    insert into product (product_id, sold_date, sold_quantity) values (1000, to_date('12-NOV-2014','DD-MON-YYYY'), 100);

    insert into product (product_id, sold_date, sold_quantity) values (1000, to_date('12-DEC-2014','DD-MON-YYYY'), 150);

    insert into product (product_id, sold_date, sold_quantity) values (1000, to_date('12-JAN-2015','DD-MON-YYYY'), 200);

    insert into product (product_id, sold_date, sold_quantity) values (2000, to_date('12-NOV-2014','DD-MON-YYYY'), 120);

    insert into product (product_id, sold_date, sold_quantity) values (2000, to_date('12-DEC-2014','DD-MON-YYYY'), 170);

    insert into product (product_id, sold_date, sold_quantity) values (2000, to_date('12-JAN-2015','DD-MON-YYYY'), 220);

    insert into product (product_id, sold_date, sold_quantity) values (2000, to_date('13-JAN-2015','DD-MON-YYYY'), 100);

    -Query

    with the temp as

    (select distinct p1.product_id,

    P1.sold_date,

    P1.sold_quantity,

    Count (*) on total_occurrence (p1.product_id partition).

    ROW_NUMBER() over (partition by product_id arrested by p1.product_id) rownumber

    the product p1

    order of p1.product_id,

    P1.sold_date

    )

    Select t.product_id,

    t.sold_date,

    t.sold_quantity,

    case

    When lag (t.sold_quantity) over (partition by t.product_id of t.product_id order) is null

    then t.sold_quantity

    When t.rownumber < t.total_occurrence

    then lag (t.sold_quantity) over (partition by order of t.product_id t.product_id) + t.sold_quantity

    When t.total_occurrence = t.rownumber

    then sum (t.sold_quantity) on (t.product_id score)

    end as sold_quantity_acc

    t temp;

    Result

    PRODUCT_IDSOLD_DATESOLD_QUANTITYSOLD_QUANTITY_ACC
    1000JANUARY 12, 2015200200
    100012 DECEMBER 2014150350
    1000NOVEMBER 12, 2014100450
    2000JANUARY 12, 2015220220
    200012 DECEMBER 2014170390
    2000JANUARY 13, 2015100270 -instead of 270, he must return to 490
    2000NOVEMBER 12, 2014120610

    Please see the comment in bold and help out me. How can I maintain the continuous accumulation of value that will keep calculation of the quantity sold. Please correct me if my approach is wrong.

    Kind regards

    BS2012.

    Select product_id,

    sold_date,

    sold_quantity,

    Sum (sold_quantity) on sold_quantity_acc (partition by product_id arrested by sold_date)

    product

    PRODUCT_ID SOLD_DATE SOLD_QUANTITY SOLD_QUANTITY_ACC
    1000 12/11/2014 100 100
    1000 12/12/2014 150 250
    1000 12/01/2015 200 450
    2000 12/11/2014 120 120
    2000 12/12/2014 170 290
    2000 12/01/2015 220 510
    2000 13/01/2015 100 610

    Concerning

    Etbin

  • Need help with custom calculation Script

    Hey everybody.  I'm using Acrobat X Pro and stumbling a bit on the syntax of the following equation.  I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3.  However, the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 &"Cell2".  For example: If the user enters "3" in "Cell3" I need the value returned at 3% of the sum of "Cell1" + "Cell2".  If the user enters "9" in "Cell3" I need the value returned for "Cell3" 9% of the sum of "Cell1 and Cell2" and the end result should be the sum of "Cell1 Cell2 + Cell3.  In more detail:

    If "Cell1" = "Cell2" $ 500 = $500 and "Cell3" = '3' then I need the returned value to be $1030,00.

    I hope this makes sense. Here's what I have so far, but alas, it does not work.  Any help would be GREATLY appreciated.

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;

    Get the value of a field, a number transformation

    var v3 = + getField("Cell3"/100).value;

    Calculate and set the value of this field for the result

    Event.Value = v3 + (v1 + v2);

    Thank you

    Solan

    I have posted a reply, but realized that it wasn't what you wanted. There is some confusion about what you want for Cell3. A hand, you say that the user enter a vaule in the area, but them you say you want its calculated value based on what the user has entered and two other field values. It seems to me Cell3 should be the domain that the user enters the percentage, and the calculated field (Cell4) script could be:

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;// get treatment field value, as a number

    Get the percentage

    var v3 = + getField("Cell3").value;

    Calculate and set the value of this field for the result

    Event.Value = (1 + v3 / 100) * (v1 + v2);

  • Need help with the calculation

    I need to calculate 3 numeric fields and have an 'A' in the 4th textField.

    example numericField1 = 40 = 40 numericField3 = 20 numericField2 and numericfield4 is the sum of 1, 2 and 3 If the total is 100 on numericfield4 =

    If this total is 100, the letter A is necessary for the value of TextField1

    I did it on compute - javascript

    If (numericField3 > 90 & & numericField3 < 100) {}

    (TextField4 = 'A');

    }

    Well something like that and work.

    What I need and I have no idea how do it, is to have a (letter) results more as if the sum is between 70 and 89 the letter B and is between 50 and 69 that the letter is C.

    but also if numerifield1 = 35, then even if the total is between 90 and 100 change of the letter b

    Here's why: NumericField1 is the COLOR. NumericField2 is the DEFAULT. NumericField3 corresponds to CHARACTER and NumericField4 in the total puntiation. If the puntuation is understood between 90 and 100 is a GRADE A product

    But if the puntuation is between 90 and 100, but the NumericField1 is = to 35, then the result is between 90 and 100 must be a letter B (grade B)

    I don't know if I did clearly. hope and hope someone can help me.

    Thank you

    I think I understand.

    Form1.Page1.Subform1.grade_::calculate - (JavaScript, client)

    If (!) (Form1.Page1.subform1.total_). RawValue == ' | Form1.Page1.Subform1.total_. IsNull)) {}

    n_ var = form1.page1.subform1.total_.rawValue;

    If (form1.page1.subform1.color_.rawValue == 35) {}

    this.rawValue = "B";

    }

    else {}

    If {(n_ > 89)

    this.rawValue = "A";

    }

    else {}

    If {(n_ > 69)

    this.rawValue = "B";

    }

    else {}

    If {(n_ > 49)

    this.rawValue = "C";

    }

    else {}

    this.rawValue = "";

    }

    }

    }

    }

    }

    Steve

  • Need help with JavaScript button to save as an event.

    Hello

    I use Adobe Acrobat X Pro and am totally new to scripting of forms in Adobe (completely new to Adobe Acrobat as well!).  There is a backup on a form button that opens the Save dialog box under using a trigger (the mouse upward) and action (execute a menu item - file > save under... > PDF...) and it works fine, however, I want to now use javascript to change the behavior of the button so that it uses a trigger (the mouse upward) and action (run a JavaScript script) , and I want that JavaScript to combine the text values in two form fields (a location drop down and a date text field) and use this string concateneated + ".pdf" as the file name when he opens the Save as dialog box.  Make sense?

    This is what I added to the button as a JavaScript so far I use a test at this time string ("NewFile.pdf") and add the string that is concatenated to the script after that I know that the script works as it should.

    var NouveauNomFichier = "NewFile.pdf";

    var pathArray = this.path.split("/"); "

    pathArray.pop ();

    pathArray.push (newFileName);

    this.saveAs(pathArray.join("/")); "

    Up to present two questions:

    1. when I click the button nothing happens, no dialog Save as or whatever it is.

    2 when I check the properties of the button depending on the Actions tab shows property to select Action "Performing a menu item", even if I chose previously 'run a JavaScript '.

    Thanks for any help!

    The saveAs method will not work if the code is placed in a key event. It would need to be in a JavaScript file to the folder level, inside a function of confidence, inside a block of app.beginPriv/app.endPriv. Each user must have the JavaScript file to the folder level. The button can then call the code in the file. It will be possible for users of the form?

  • Need help with Javascript automated e-mail

    I am trying to modify a form to add a button that takes the values of the fields that will be filled in by the user and then send an email using these fields

    currently I have the following script:

    var A = xfa.resolveNode("topmostSubform.Page1.Work_Order__").rawValue;
    var B = xfa.resolveNode("topmostSubform.Page1.NOMENCLATURE").rawValue;
    var PPC = xfa.resolveNode("topmostSubform.Page2.Email_Address_PPC").rawValue;
    void var = 'work created order. "
    var msgBody = "Order of work" + A + "\n for the" B + "program has been created"; "."
    app.mailMsg ({}
    bUI: false,
    cTo: PPC,.
    bassujetti: void.
    CMSG: msgBody,
    });

    Thanks for your help,

    John

    Hi John,.

    Your script looks not too bad. Here is our generic script:

    var vEmail = "[email protected]";
    var vSubject = "A Subject for your email";
    var vBody =  "Put your body message here...";
    
    event.target.app.mailMsg({
         bUI: true,
         cTo: vEmail,
         cSubject: vSubject,
         cMsg: vBody
    });
    

    Try putting "event.target." before the app.mailMsg. Also you need not of the xfa.resolveNode, if the items, pages, and the subofrms are appointed.

    Hope that helps,

    Niall

  • Need help with javascript...

    I have a form that I want to send. When it creates the email, I have a script which inputs e-mail sender, a subject line that between the body of the text, including the name of the employee as well as the date and the name of the person completing the form from the "empName" field specified in the field 'weekend '. I want to add the totals for each line (regular, vacation and sick). For some reason, the script stops when I try to add row grand totals. When it works, here is my script:

    var oDoc = event.target;
    
    oDoc.mailDoc({
    bUI: true,
    cTo: "[email protected]",
    cCC: "[email protected]",
    cSubject: "Weekly Employee Time Summary for "+empName.rawValue,
    cMsg: "Attached is the Weekly Employee Time Summary for "+empName.rawValue +" for the week ending "+weekEnd.formattedValue
    });
     

    If I just add one line totals, the Send button does not work. Here is the code with the addition of a line total:

    var oDoc = event.target;
    
    oDoc.mailDoc({
    bUI: true,
    cTo: "[email protected]",
    cCC: "[email protected]",
    cSubject: "Weekly Employee Time Summary for "+empName.rawValue,
    cMsg: "Attached is the Weekly Employee Time Summary for "+empName.rawValue +" for the week ending "+weekEnd.formattedValue +". Vacation Total: "+vacTotal.rawValue
    });
     

    Any ideas why it's a failure? Attached is the file itself

    https://drive.Google.com/UC?export=download & ID = 0B3ZhSiIWrwvWUUhfa0hCZlJFX00

    You must write the path to the object, you cannot access the object if it is in the same subform or if it has a similar parent

    You should write this to access your total value inside the table

    Table1.vacation.vacTotal.RawValue

  • Need help with javascript used to check the data in the mandatory radio button fields

    required_fields

    I get a syntax error (SyntaxError: missing: after the id property 17; at line 18).  I am trying to run a script to verify data in all the fields required radio button before letting the user to submit the form (or save).  Here is the code I use:

    var AllRequiredFieldsSet = true;

    for (var i = 0; I < this.numFields;i++)//loop through all form fields)

    {

    var fldName = this.getNthFieldName;

    var currentFld = this.getField (fldName);

    if(currentFld.type=="radio")

    {

    All the radios that are needed to see if the user filled their

    if(currentFld.Value=="OFF")

    AllRequiredFieldsSet = false; one of the option boxes has not been selected, this form cannot be sent

    }

    }

    If (AllRequiredFieldsSet is false)

    App.Alert ("all the required areas have not been met");

    on the other

    this.submitForm ({cURL"mailto:EMAILADDRESS@gmail.com", cSubmitAs: "PDF"});

    Miss me not all media... Any ideas on what I'm missing?

    Thank you! Judy

    These two lines should fix things:

    var fldName = this.getNthFieldName (i);

    ...

    if(currentFld.type=="RadioButton")

  • Need help with JavaScript/region templates and APEX (Show Hide region)

    I have a page that I am building where I want to use a form of a page but the swap areas (without reloading the page). In my example form, I have 3 areas I want to talk about as general, Major, Standard. I have them where they will be show and hide but the result is not satisfactory, because even if the region is hidden, the white space remains there where he was. Basically I want the form to continuous flow when the effect is that Standard replaces the more important or Major replaces the standard when you change the menu drop down.

    Link to the example on apex.oracle.com: http://apex.oracle.com/pls/otn/f?p=23948:1
    Developer Access:
    workspace: dapullia
    username: guest
    password: demo
    The application number is 23948

    Hello David,.

    Instead of the "visibility" of switching you must pass the 'view' of the 'block' to 'none '.
    If your code should be something like this (using the notation of APEX javascript library)

    $x("MAJOR_EVENT").style.display = 'block ';
    $x("STD_EVENT").style.display = 'none ';

    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    You can reward this response in marking it as useful or Correct ;-)

  • Need help with JavaScript web application form.  Need to limit the pixels and the size of the image

    I build several forms for www.iswapusa.com and on the site, visitors are asked to upload images, I want to restrict the width in pixels max 400 pixels and size to maybe 1 MB to 3 MB of the file images if possible.  If there is a code to do this, please let me know and where do I put it on business catalyst system. to work with forms I create or even if I have to give to each form.  The forms are available from one of these pages offer commercial or Non-commercial offer.

    I found the answer to my problem.  It is not a java solution, but a simple code.  You can create in your retail or list view depending on where you want the images appear of your form will be mailed.  the answer was in a previous post, and the link is:

    Dynamically generating thumbnail images

    The code I used was:

           

           

           

  • Need help with the calculation of the inventory running

    Hi Team, 
    
    I have requirement below,
    
    _*Input*_
    
              
    Pck     TotInv     Qty 1     Qtry 2     Qty 3
    Pck 1     10000      0      0      0
    Pck 2     0     50     30     100
    
    _*ouput*_
    Pck     TotInv     Qty 1     Qtry 2     Qty 3
    Pck 1     10000     9950     9920     9820
    Pck 2     0     50     30     100
    
    The following logic is used
    Qty 1 for Pck 1 = Tot Inv - Qty 1 from PCK2 
    
    Qty 2 for Pck 1 = Qty 1 from PCK1 - Qty from PCK 2
    
    Qty 3 for Pck 1 = Qtry 2 for Pck 1 - Qty 3 from PCK 2
    
    Kindly assist me here, i hope i am clear in my explanation,
    
    Regards
    nic

    Right button correct Please push or useful.

    select *
    from t
    model
    dimension by(pck)
    measures(TotInv,Qty_1,Qty_2,Qty_3)
    (
    Qty_1['Pck 1']=TotInv['Pck 1']-Qty_1['Pck 2'],
    Qty_2['Pck 1']=Qty_1['Pck 1']-Qty_2['Pck 2'],
    Qty_3['Pck 1']=Qty_2['Pck 1']-Qty_3['Pck 2']);
    

Maybe you are looking for

  • Apple Watch

    During the year of market my Apple Watch sometimes sounds and closes the session without asking for confirmation.  Any ideas on what goes wrong and how to fix?

  • How can I check (for tax purposes) a gift that I made to Mozilla?

    I made donation of $500 at the end of 2013 and need to check. (I know it is other kinds of support generally available here, but I can't find any E-mail address or phone number from which to ask about it). Thank you!

  • DVD drive no longer works on the Satellite X 200

    Hello Although my laptop X 200-191 is just 3 weeks, this afternoon the DVD player suddenly stopped working. When I insert a dvd, the drive makes sounds like it will play the DVD, then stops and nothing more happens. When I click on the DVD drive in '

  • Pavilion dv7-6163us: 2nd hard drive dv7-6163

    What is needed to put a 2nd HDD in my laptop? And where can I get parts? The size of a 2nd disc can use?

  • to end a process in exec system via ctrl + c

    I run a process in the command that is invoked by exec system window. The only possible way to complete and return to the main command window is via Ctrl + c. How to implement it? No idea...