Custom endangered calculations

I use Acrobat XI and I am new to using javascript custom form calculations.  I have three fields.  First, both for the user to fill in numbers. The third field is where I am come with the calculation.

Here's what I did

  • I have added custom calculate script by viewing the properties of the field in the form, by accessing the tab calculating and entering my javascript custom in the section "custom calculation Script".
  • I clicked on "Close form editing" and I immediately saw my field change from white to a $0.00.  Great, it looks that it works.  I then entered the values in the first two fields and the third field indeed calculate the total exact. Great!
  • So I went back to the change in the form.  The third new field properties, and all of a sudden my script disappeared.  I closed form again to change, change the numbers in the first two fields, and the third field is not updated.  What?
  • I started the process again.  Tested the script, everything has worked well.  Has continued to edit other fields, returned to that field and again, the script has disappeared.


Does anyone know why scripts disappear?   Is this a bug?  Or, I'm just not do something?


(For the record, my fields are formatted as numbers)


Any idea is appreciated.


Thank you

Delete the field, save the file, close it, reopen and then add the new field and try once more.

Tags: Acrobat

Similar Questions

  • editing custom and calculations of form fields?

    On my excel spreadsheet report I follow the progress of the construction in linear feet of number from one station to the other.   Numbers station expressed exactly as with decimal places except the decimal point is replaced by the sign ' + '.  So if we type inOn my excellent spreadsheet report I follow the progress of the construction in linear feet of number from one station to the other.   Numbers station expressed exactly as with decimal places except the decimal point is replaced by the sign ' + '.  So, if we're typing in 200, it becomes 2 + 00 (which means station # 200... either 200 feet from the starting point of 0 + 00) it's really easy game this place in excel through shaped custom and isn't able to subtract effect station # else automatically calculates the daily footages.   How can I go to learn how to implement in the acrobat form fields?  Thank you

    OK, you can use the following script to custom size for a text field:

    Custom Format script for the text field

    If {(event.value)

    (Event.Value = util.printf("%.2f", event.value / 100) .replace (".", "+");

    }

    This can be expressed in plain language with: If the field is not empty, divide the value by 100, round off the result to the tenth closest and replace the comma with a sign more.

    A script format is used to change what is displayed in the field the value of the underlying field leaving unaltered, so the value of the field can be used in normal numeric calculations.

  • Custom endangered code snippets

    Last week I meticulously recreated in CS5 DW, Mac, custom Snippets folders, I had used in DW CS4 Win - because I did not find a quick way (it should have been a) to export my existing CS4 Windows code snippets and import the file in my new Mac DW CS5 installation.

    Later, I restarted the Mac for a software update. When I restarted DW and went to look for my folder of excerpts in its usual place, grouped with files and assets, he missed. I raised it from window > extracts - and discovered that all of my carefully constructed custom excerpts had disappeared. Only DW ready-to-wear stock extracted files were present.

    I checked the Forums, learn where custom code snippets were supposed to be (in / < user > / Library/Application Support/Adobe/Dreamweaver CS5/fr_FR/Configuration/Snippets ) and took a look. Nothing. Not even a folder of excerpts in this place.

    What has happened to the devil, and how to avoid an unpleasant and very embarrassing loss of data/work situation again?

    BTW, I still have access to my Windows DW CS4 excerpts. If there is something that I missed on a global export for custom snippets, I would of course to know. The procedure should be as easy as exporting Site definitions. (Or easier, really; the one-at-a-time Site Defs export arrangement is not exactly a winner in terms of ease of use.)

    Thank you.

    bemdesign wrote:

    Yes a bit of a hack, and it would be nice if Adobe made it easier to export these settings...

    Snippets are stored in files with the extension .csn. However, if you open a .csn file in a text editor, you will see that it is simply an XML file. Normally, just copied the files is the simplest way to manage the migration of the extracts.

    However, is there an official way to migrate extracts, which is to pack them as an extension. It is not particularly difficult to do. It involves the creation of an XML file (with a .mxi file name extension) that contains the details of the watch. Extension Manager because the rest. I did it several times with extracts of distribution package with files that accompany some of my books.

    There is a model for the XML file in the following location: C:\Program Files (x 86) \Adobe\Adobe Extension Manager CS5\Samples\Dreamweaver\DreamweaverBlank.mxi (it is in a similar situation in the Applications folder on a Mac).

    The following example shows how I packed up the code snippets for my Dreamweaver CS4 book:

    
    
        
    
        
    
        
    
        
            
         
    
        
    
        
        
        
    
        
    
        
        
        
    
        
    
        
            
            
            
            
            
            
            
            
            
        
    
        
    
        
        
    
    
    

    Basically, you fill in the name, version number, and the type of extension. Because I was packing several excerpts, I used "suite" as the type. For a single excerpt, the correct value is "codesnippet.

    Fill in the name of the author, description, and tags access is optional. Important section is the file tag, that contains a tag to a separate file for each excerpt. The name attribute is the name of the file .csn for the excerpt. The destination always starts by $dreamweaver/configuration/followed by the name of the or the folders where the files need to be installed. In the case of code snippets, you use excerpts followed by the name of any subfolder that you want to store in. The destination records need not exist. Extension Manager automatically creates.

    For more convenience, I copy the .csn files in the same folder as my .mxi file. Otherwise the attribute name for each .csn file must include the path to the location of the current file.

    Launch Extension Manager, select file > Package MXP Extension, then navigate to the .mxi file. Name using the name of extension .mxp extension file, then click Open (this is probably to choose on a Mac). Extension Manager generates the .mxp file, which can be used to install the clips on any computer, regardless of operating system.

    As I say, it is not difficult, but it is not as simple as simply copy and paste excerpts, it is why the official way is not known.

  • Is it possible to use formulas (for example 'if' or VLOOKUP functions) in the "custom calculation Script?

    I'm working on a PDF form fill converted from MS excel. It is for others to use who do not have MS excel required to use my spreadsheet.

    1. I would like to know, how can we have complex formulas being the custom tab calculation script calculate under properties in a menu of cell?

    2. where can I find it that the formulas will work in the calculation script custom as well as the format of these formulas work properly (tutorials would help)?

    I tried to write an 'if' function but I get and error so I guess that is functions do not work in the script, or there is a different format of spreadsheet standard formats.

    Bruce

    .

    In this case the loop would be:

    for (var i = 0; i)< 8;="" i="" +="1)">

    sum += + getField("Total."_+_i).value;

    }

    So initially, the counter i is zero, so the domain name used with the getField method is:

    'Total': + 0, which results in the string "Total.0". At each iteration, the variable i is incremented by 1, so the following field names are the following:

    "Total.1".

    "Total.2".

    'Total.3 '.

    'Total.4 '.

    'Total.5 '.

    'Total.6 '.

    "World.7.

    The script gets the value of each field, it converts numbers and adds the number to the cumulation.

  • Calculation to Elim in HFM entity such as Elim entities in the enterprise

    I was responsible for the HFM work as business - how can I fill an Elim entity with data [disposal] publishes on real entities during consolidation?  Since there is no data is not loaded in the ElimEntity and the accounts are not marked IsCalculated, I created a custom ElimCalc calculated to try to realize the calculation of uncalculated accounts.

    I tried every iteration elimination consolidate the function within the sub section.  I tried to fill the elim calculate entities through the sub section.  All epic fails.

    Can someone point me in the right direction with this?  I tried to show the client that the data they need is in the dimension of value [disposal] that these data may be attracted to consolidate reports.  However, they want the Elim entity to be part of children of parent in a column of the report rather than have two columns to give the Curr Total entity and the elimination.

    There must be a solution to this and I've exhausted ideas.

    Thanks a lot for this reading and offering suggestions.

    I've done a few times. I highly recommend that you avoid creating entities from the elimination. Do all you can to convince users that they have no need of specific entities of elimination. Use rather a custom size 'data type' to store the values of the elimination.

    To answer your question, however, you can (and should) use Sub consolidate to do this, not to calculate the Sub. The HS. Con function takes the [Total Parent] entity data and writes to the current entity [percentage] and/or [disposal], OR node, node [disposal] any entity brother. This means that you must create elimination entities named 'ParentEntity_Elim '. The rules, to consolidate the Sub would look like this:

    Void Consolidate()

    '************************************************************************************************************************************************************
    ' Consolidate the Routine
    '
    ' 1 of 8 routines default HFM
    ' (Default HFM routines include Calculate, translate, consolidate, Allocate, NoInput, entry, dynamic & Transactions)
    '
    "The following categories of logic are treated here:
    (1) the consolidation of all data on the percentage of Consolidation (PCon) of the node (parent single & child)
    (2) elimination of intercompany transactions
    '
    "When consolidate it Routine runs, it extracts data from the amount '[Parent]' Member, makes him.
    "specified calculations and, by default, writes the result to the Member"[percentage]. "
    "It is also able to write the result to the Value"[disposal]"Member as he does performing intercompany
    "investment in overtime and eliminations of equity."  We can also write the "[share].
    "and"[disposal]"members of the entities of the siblings.
    '
    "Consolidate routine runs when a user highlights a parent entity and selects"peacebuilding. "
    ' ' Consolidate all with data ", or"Consolidate all"option in the right-click or the list of menu items Action menu.
    '
    '************************************************************************************************************************************************************

    sParent HS =. Parent.Member ' get the entity parent of the parent-child node being calculated
    HS = nPCon. Node.PCon("") ' get the property of the account system "[PCon]." By default, it is equal to 1 (= 100%).

    "Pull in the memory of all points of data (records) of the unit of current data.  These data represent all data stored in member account,
    "PIC and the dimensions of the customs.
    Define further HS =. OpenDataUnit("")
    nNumItems = duAll.GetNumItems ' get the number of data points in this unit of data.

    ' Loop through each data point and run the logic within this loop
    For i = 0 To nNumItems - 1
    "Get information about that data point, including labels for the account, PKI, and customs as well as the (dData) value of the data point
    Call duAll.GetItem (i, sAccount, sICP, sCustom1, sCustom2, sCustom3, sCustom4, nData)
    If nData <> 0 Then ' do not consolidate zeros
    Dial the HS. Con ("", nPCon, "") ' apply the PCon property to the data point and write the results to the Member Value '[percentage].
    'Run the logic of elimination for intercompany balances '.
    Call eliminate them (sParent, sAccount, sICP, sCustom1, sCustom2, sCustom3, sCustom4, nData, nPCon)
    End If ' dData <> 0
    Next ' I
    Further = Nothing set

    End Sub ' consolidate

    Void remove (sParent, sAccount, sICP, sCustom1, sCustom2, sCustom3, sCustom4, nData, nPCon)
    '************************************************************************************************************************************************************
    "Eliminating the Routine."
    '
    "Criteria".
    '
    ' This routine assesses each data point that passed to the routine to consolidate and eliminates data points
    "If the following criteria are met:"
    '
    (1) is not a member of PKI "[ICP None]", IE. an intercompany partner has been specified
    (2) the parent of the entity being grouping is an ancestor of the specified PKI
    ' OR
    "The mother of the entity being grouping is included in a geographical hierarchy of"
    (3) the account is reported as "IsICP" in the metadata
    (4) the account has a "PlugAcct" specified in the metadata
    '
    "Computation".
    '
    "He made the elimination with 2 steps:"
    1) multiply by PCon - data point and writes the result to the Value «[disposal]» Member
    (2) multiply the intercompany by PCon data point and writes the result to the Plug account, Member of the value "[disposal],"
    "while other members of the same size
    "Please note that if your application writes the eliminations at an intersection of the particular custom dimension, add the Cx member of the harmonized system. Functions of con.
    '
    '************************************************************************************************************************************************************

    "This subroutine is currently not used and is here only as a placeholder for once when the application starts to run automated inter-company eliminations."

    bCanEliminate = True

    If (HS. Account.IsICP (sAccount) = False) then 'ignore accounts not flaged's PKI
    bCanEliminate = False
    ElseIf (StrComp (PSCI, "[ICP None]", vbTextCompare in) = 0) then ' ignore anything in the [no PIC] member of the dimension of the PKI
    bCanEliminate = False
    ElseIf (HS. Entity.ISDESCENDANT (sParent, PSCI) = False) then 'ignore eliminations if the intercompany partner is not a descendant of the parent of the current entity.
    bCanEliminate = False
    On the other
    sPlug HS =. Account.PlugAcct (sAccount)
    If (sPlug = "") then
    bCanEliminate = False ' ignore the elimination if there is no identified account in the account of the PKI card
    End If ' record = «»

    If bCanEliminate = True Then ' if all criteria is met as a removal should be performed, proceed
    "don't forget that nPCon contains the percentage of consolidation, that most, if not all the time should be 1 (100%).
    Dial the HS. Con ("V #[disposal].") ("E #" sParent & '_Elim',-1 * nPCon, "") ' multiply the amount of PKI-1 and write the value member [disposal].
    Dial the HS. Con ("V #[disposal].") "A #" & sPlug & ".." ("E #" & sParent & "_Elim", nPCon, "") ' write the amount on behalf of making PKI and write as the value member [disposal].
           
    "The following examples show how you might change the destination POV to include a custom dimension intersection.
    "Call HS." Con ("V #[disposal].") (C3 #AutoElim',-1 * nPCon, "") ' multiply the amount of PKI-1 and write the value member [disposal].
    "Call HS." Con ("V #[disposal].") ("C3 #AutoElim.A #" & sPlug, nPCon, "") ' write the amount on behalf of making PKI and write the value member [disposal].
    End If ' bCanEliminate = True

    End Sub ' remove sup

  • Calculated field with the currency formatting, and hiding the values null

    I am designing a PDF form for quote and I have a field defined to multiply the amount of an article and the unit price to the total price.  There are 5 lines on each quote, and if users are citing only 1 or 2 items I want the values null in fields unused price extended to be hidden.

    I did it with the following script

    If (event.value == 0) event.value = ";

    But when I enter the quantity and total price of price is displayed as a regular number (100) instead of currency ($100).

    I can format to currency with

    Event.Value = util.printf ("$%.2f", event.value);

    I don't know there's a way to combine to give rise to such a situation then, so if the field is 0, make null and if not then format as currency but I don't know how to do it.

    Any help would be appreciated.

    Andrew

    Newer versions of Acrobat hide zero for fields values using the number format and with a currency symbol. »

    But since you can't control the updating of user systems, you must use a small function documented for formatting numeric fields on the fly.

    With the extended price field set to 'None' format, you can add the following script to the Validation script "Custom" or add it to a custom JavaScript calculation. The "Custom Validation will work with any method of calculation. Note that the form must be cleaned or recalculated to see the result of the validation script change.

    if(Event.Value == 0) {}
    Event.Value = ""; set the field value to null to a value of zero
    AFNumber_Format (2, 0, 0, 0, "", true); number with no currency symbol format
    } else {}
    AFNumber_Format (2, 0, 0, 0, "$", true); for the format of the values non-null for number with the currency symbol
    }

    The positional parameters are the number of decimal places, the Style separator, negative value Style, Style of (unused) currency, currency symbol, the currency symbol Pre-hanging chain.

  • Calculation of a field with a minimum of response?

    Hello all-

    I have a product which costs $22 per thousand. I have a field for the quantity and a total field.

    Right now I have it set up like this:

    Area 1: 'Qty 3' - customer enters the desired quantity

    x

    Field 2: '22' - hidden, used for multipliers

    x

    Area 3: "001" - hidden, used.001 for multiplier give the total price.

    My problem is that the minimum price is always $ 22. How to ensure that the total word: "If the total is < = 22, then 22.» Another thing, Total. »

    Thank you. No idea on javascript...

    You can use the following in the custom field calculation script:

    (function () {
    
        // Get the quantity
        var v = getField("Qty 3").value;
    
        // Set the price per thousand
        var costPerK = 22;  // Cost/thousand
    
        // Set the minimum cost
        var costMin = 22;
    
        // Calculate the total cost
        var costTotal = v * costPerK / 1000;
    
        // Set this field to the total cost if it's more than the minimum, otherwise use the minimum
        event.value = (costTotal > costMin) ? costTotal : costMin;
    
    })();
    

    You don't say what you want to happen if field 3 is empty. If you want the value to be blank, add after line that gets the amount:

    if (v == 0) {
        event.value = "";
        return;
    }
    
  • HFM: Cannot lock entities due to the control of process state

    Hello

    I want to block some previous years, e.g. 2000-2010.

    In the settings of the metadata for the scenario property 'PhasedSubmissionStartYear' is defined in 2013.

    If I try to lock the 'old' years before 2013, an error has occurred: the processing unit can be locked, because his level of process is not "published".

    Why is that?

    So I need to go through all the necessary steps to control the process for all years?

    Thanks in advance!

    Hello. The short answer is Yes, you have to cross and promote annually to publish before locking (start, present and publish). The year of beginning of gradual submission to use presentations by steps (several approvals by period) only.

    A suggestion: lock only the entities of base level, not the parents. The parents of locking that will prevent the data change when the hierarchy is changed, but if you ever have a change which must be retroactive so all changes are applied in any case. Org by period is better functionality to keep the old hierarchies in place. Do not forget that the accounts of parent and parent's customs are calculated in memory so they do not get locked in place; just the entities.

    Eric

  • Form Adobe creating a total

    Hi all

    I have an order of pages 5 and it would be a great help for the person who enters an order of the completed form, if there is a field indicating how many fields have a quantity.

    Currently, to read through the 5 pages, which means that it is possible to miss a line.

    I thought that I could create a field on the first page that shows how many quantity fields have been filled.

    Is this possible?

    I create a javascript to do the following for each field:

    Look first field qty1 - is there a value? Yes, make that 1. If no value do nothing.

    Look at the second field 2 - y has a value? If yes what to do 2. If no value do nothing.

    Continue on each field.

    Is this possible? I have about 100 quantity fields.

    I tried to use the export data, but it's the CSV with my quantity across the page while I need to be to the bottom of the page. Don't know how to transpose data during export.

    Any help would be greatly appreciated.

    Concerning

    Vera

    You will need to create some custom JavaScript calculations to test the fields to not be empty or be set to 0 and then to count.

    Export data are very limited and if you want to order the fields, wisely chose your names.

  • calculate the total based on text filled fields

    Hi, I have 5 text fields to fill out my form. first 4 fields are normal text fields to fill & 5th is total field. each field value is $ 15. what I want to do, is if the first field filled with any text and then the field value total is $ 15. If it is filled with second text fields and field value total $30. like this, he must calculate all 4 total fields. pls help me to handle this. Thank you...

    You can use something like that the custom field calculation script total (simply adjust the field names, of course):

    var total = 0;
    if (this.getField("Text1").valueAsString!="") total+=15;
    if (this.getField("Text2").valueAsString!="") total+=15;
    if (this.getField("Text3").valueAsString!="") total+=15;
    if (this.getField("Text4").valueAsString!="") total+=15;
    event.value = total;
    
  • Need help with a script (o - o8) *, see the Virgin if there is no

    Hi all what I need help with a script I can't find an example.

    I'm trying to subtract 2 numbers and then multiply this product. (o o8) * one but I just want to do the calculations if all fields have the numbers IE field o, o8 of field and field one.

    Thank you in advance. I was stuck on this days searching the Internet.

    Assuming you want to affect the outcome of this calculation in another text field, use this code as a custom field calculation script:

    var o = this.getField("o").valueAsString;
    var o8 = this.getField("o8").valueAsString;
    var a = this.getField("a").valueAsString;
    if (o!="" && o8!="" && a!="") event.value = (Number(o)-Number(o8))*Number(a);
    else event.value = "";
    
  • 'Live sélections' 8-bit?

    I have trouble to get a complete answer here on the Adobe Forums.  I sent Jeff Schewe on the issue but did not get anything back for the moment.

    Years ago I was getting posterized in my enlargements of 16-bit and asked Jeff and others here why that might be. The question gave me was "you are using a ' live selections" in your mask? And then I saidlive selections are always 8 bit"even in a space of 16 bits.  I immediately abandoned my 'selection live' various technical of masking and the Posterization went away for good (I do Gallery extensions full time). I have been educating people about this for 6-7 years now. I use the "Mix" layer Style so, or I create customized through calculations now 16 bit masks.

    But a controversy has brewed lately on the use masks of brightness of Kuyper.

    Here is his quote:



    "Last year, I started to receive questions by e-mail on whether brightness selections change the bit depth of selected pixels from 16 bits to 8 bits." The answer is 'No.'. It would take something like the Image > Mode control to do so. A little research, however, showed whence came this misconception. It turns out that regardless of the bit depth of the image, the selections are always 8-bit. Even on a 16-bit image, the selections are always 8-bit. The depth of selection, however, refers only to the degree of possible selection as part of the selection (up to 256 for 8-bit). However, the depth of the image, described the amount of color information, each pixel can display (65 536 levels for each color in RGB channel). They are not the same thing. The degree of 8 bits selection is just to determine how adjustments are passed to the pixels below. It does not change the accuracy of 16 bits of data in these color pixels. »



    It seems to me that if it is said that the selections in its masks are not actually of 8 bits, or made up to 256 levels.


    Please help me to get to the bottom of this issue.


    Thank you much in advance.


    A link to his explanation is here for those who might be interested:How to do 16-bit brightness masks | Good light newspaper




    I have no idea whether or not Kuyper mask selections are 8 or 16-bit, but if selection began by dancing ants selection before the Save in a channel or a layer mask, then they are 8 bit to start and will not magically becomes 16-bit.

    Channels & layer masks are 16-bit 16-bit documents, selections are always 8 bits.

    Could be a case of use of advocating a bit depth higher for 16/32 bit and Chris files would be a good person to ask (although I think it would be a lot of work for relatively few users).

  • Create Java with Essbase applications

    Dear Experts

    I have a request for a potential customer.

    Where I think it's better to implement an application with Java or APEX, another relational database and Essbase.

    How Hyperion Planning and others.


    But not using Hyperion Planning.

    How it would integrate with Essbase?

    How can I create a Java application without losing anything of Essbase?

    Anyone already done this?

    Should what documents I read about it?

    A lot of questions and design challenges.

    Thank you for all

    For the purposes of the Apex

    -You can use custom Essbase calculation relationships

    http://Essbase.ru/archives/6273

    with XMLA PLSQL API

    https://code.Google.com/p/Essbase-PLSQL-interface/

  • Form field drop-down

    We need a drop-down menu to automatically fill in another field of text on the same form.

    You need to use custom scripts to do this. It can be done either with the personal calculation, with the help of a custom key combination or the blur (out of scope).

    For the target filed, you use the custom JavaScript calculation:

    Event.Value = this.getField("Combo_Box1").value

    You will need to change the "Combo" Box1 to your domain name.

    For the drop-down list outline key custom field:

    if(Event.willCommit == false) {}

    this.getField("Text3").value = event.changeEx;

    }

    You will also need to set the option "commit selected value immediately" for the drop down field.

  • TextField mutiply by value when the box is check

    Hi all

    I have a form, built in Adobe Acrobat X Pro, I create as a form of reparation with charges included in it.

    I know how to have a value filled in a text field when a check box is selected.

    My question is this.  I have a textfield labeled as "labor_hrs" which is a number format.  What I want to do is to have this box multiplied by a given value of populous 45.00 to the text field 'labor_chrg '.  Can I get this feature to work on its own.


    I want to do is only to be filled to the "labor_chrg" when the "billable" checkbox is checked.


    adobe.png

    Any help would be appreciated.

    A quick way is to set the export value of the checkbox "billable" 1.

    You can then use the simplified field notation script of:

    (labor_hrs * 45) * billable

    A custom JavaScript calculation:

    function GetField (cName) {}
    Returns the field with error checking object;
    oField var = this.getField (cName);
    if(oField == null) app.alert ("field of error for access to the"+ cName, 0.1 ");
    return oField;
    } / / end GetField function;

    Event.Value = (isNaN (GetField("billable").value) == false) * GetField("labor_hrs").value * 45;

    If you add a hidden field to the rate of work called "labor_rate", you can use the ' field is the product of the following fields: "and select the fields"billable","labor_hrs"and"labor_rate ".

Maybe you are looking for