How to make a script that runs only if another field's value

I have a field in the sales tax in my form

I do not charge the sales tax in TX, so when they choose the TX State on this field. I want to implement the sales tax.


I am looking for how exactly that and am not having any luck.

If it's for a calculated field, you can use a JavaScript custom script to do this, something along the lines of:

// Calculate script for text field
(function () {

    // Get the value of the State field
    var state = getField("State").value;

    // Get the subtotal
    vat total = getField("SubTotal").value;

    // Set the tax rate
    var taxRateTX = 0.0825  // 8.25%

    // Calculate the tax if Texas
    if (state === "TX") {
        event.value = util.printf("%.2f", total * taxRateTX);
    } else {
        event.value = "";
    }

})();

Change the field names in the code to match your form. I'm assuming that the State is selected in a combo box (dropdown) and it gives a value of "TX" when Texas is selected. Copy the following code rounds up to the nearest cent (assuming that subtotal is in dollars) which maybe aren't correct.

Tags: Acrobat

Similar Questions

  • Transformation of Scripts that run only on the selected Tables

    I'm relatively new to Data Modeler, but found almost everything to be very intuitive. I'm now doing use custom transformation scripts to dynamically add custom DDL elements. I wrote a transformation script that adds a sequence at the end of my DDL trigger successfully, and I'm happy with the results. The problem I run into is that we have two different categories of tables that require slightly different sequence triggers, but as my model is set to the level of database, my transformation scripts are applied to all arrays regardless they come what schema. Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if statements to check what schema tables are coming from, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same pattern, how can that I manage that? Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

    I work in a relational model with Data Modeler 4.0.

    to dynamically add items customized to DDL

    you need to check the custom of DDL in DM 4.1 features - "tools > rules and design transformations > Table DDL transformations"-DM 4.1 comes with example to generate tables of the newspaper and associated trigger.

    . I wrote successfully in a transformation script that adds a sequence at the end of my DDL trigger

    Data Modeler can generate the sequence and relaxation for you - you need to define the column as 'auto increment' / identity and set in preferences, you want "trigger" put in place. 4.1 DM added support for z/OS, DB2 LUW DB2 and MS SQL Server 2012.

    Do you have any suggestions on how to limit the tables which proceeds by a transformation script? I thought to add if the instructions to check the schema, the tables are coming, but if I have a situation where I have two different tables that require two different processing scripts, but they are in the same schema

    Well you need to sort it out on yourself - you can use classification types, dynamic properties user defined properties (in DM 4.1) or put paintings in various subviews or use the search feature (4.0.3 DM / DM 4.1 comes for example how to use the search results to create subview).

    Ideally, I'd like to just pick a table and apply a transformation script for this table individually. Is this possible?

    Here is an example of how get selected tables:

    appv = model.getAppView();
    dpv = appv.getCurrentDPV();
    //check there is a diagram selected and it belongs to the same model
    if(dpv!=null && dpv.getDesignPart() == model){
     tvs = dpv.getSelectedTopViews();
     for(var i=0;i
    

    Philippe

  • The fields that display only if another field contains information.

    I have a form that has multiple to sign. There is one for the Patient to sign that has the date automatically show (I work with a global in the previous entry). Then I have another box sign below this one for if the Patient is unable to sign.

    I want to do is date (B) to refer to a previous entry with date (A) correct, unless there is information entry in another field (D), then 'B' field must be empty and 'C' field will have the referance to "A".

    Example of form:

    Date (A): _

    Signature: ___Date patient (B): _

    Representative signature: ___Date (C): _

    Representative name (D): _

    I hope this is enough information in the right format for the answer to this problem. Thank you.

    Hello

    There are probably a number of ways that you can address the issue.

    While normally I try and keep the script in an object/event, here I will recommend a small script in the events to calculate dateB and dateC.

    dateB calculate event:

    if (repName.rawValue === null)
    {
         this.rawValue = dateA.rawValue;
    }
    else
    {
         this.rawValue = null;
    }
    

    dateC calculate event:

    if (repName.rawValue !== null)
    {
         this.rawValue = dateA.rawValue;
    }
    else
    
    {
         this.rawValue = null;
    }
    

    Hope that helps,

    Niall

  • How to make the plugin that works in the background?

    Hi, I need to make the plugin working in parallel in the background thread. It should start when Photoshop starts and stops when closing Photoshop. I think that the plugin type should I choose is "Automation" but these plugins are executed only when the user calls the plugin in the menu. How to make the plugin that runs when photoshop works without the need to invoke it manually? I don't want this plugin to be visible in any menu. This plugin is designed to work with the extension of the CEP.

    I ended up making invisible CEP extension that performs background tasks in the timer event handler:
    CEP 5 Extension HTML Cookbook for CC 2014 · Adobe-CEP/CEP-resources Wiki · GitHub

  • How to make a page QML figurentsur only the first launch

    How to make a qml page appears only on the first time the application is started?

    I need to create a tabbed pane and the number of tabs depends on n the input from the user to whom it provides the first launch. How to make this happen?

    You can use QSettings to store parameters.

    Create two main qmls (mainHasInput.qml and mainHasNoInput.qml). When the user runs your application for the first time, load mainHasNoInput.qml. If the user enters the input values correct, who writes in your QSettings. The next time that the launch of the app, you check if a setting has been stored in your QSettings. If not, show your mainHasNoInput.qml, if yes, see the mainHasInput.qml (which is your main 'normal' screen)

    for an example how to use QSettings, see https://developer.blackberry.com/native/sampleapps/ -> 'persistent objects '.

  • How to make a record that I downloaded on my computer and to make into smaller files so that I'd be able to send them an existing voice mail? From now on, the file is large to send

    How to make a record that I downloaded on my computer and to make into smaller files so that I'd be able to send them an existing voice mail? From now on, the file is large to send.

    Hi kristieann,

    ·         What version of the operating system is installed on the computer?

    You can search for any third-party application, using your favorite search engine to split the recording file.

    Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How to make a picture that I put on my printer in my computer?

    How to make a picture that I put on my printer in my computer?

    The easiest way is to use a scanner to scan the picture.  Of course if you don't have a scanner, so it is more problematic.  Another way would be to have someone take a photo of the print with a digital camera and upload the image on your computer or on ancestry.com for you.  Take a photo of the print is not the best and takes some skill, but it's a way.  You can also take the printout to a place of photo processing.  If you live in the United States, then Wlagreens, Wal-Mart or a similar place probably can scan the photo for you put the results scanned on a CD or a flash drive for you, then use the results to ancestry.com.

    BTW: One of her grandchildren have to do for you.  If it's done before you know what happened.  We old people have to stick together and help each other, good luck!

  • Hi help me make sure is it you please how to make my header that I defined in a template to be top of my web pages when I parade

    Hi help me make sure is it you please how to make my header that I defined in a template to be top of my web pages when I parade

    Please follow the steps:

    -Go to the Master Page

    -Open the layers panel

    -Add a new layer

    -Do drag the content (header) back layer

    If ' make sure that the new layer is the top layer in the layer panel.

    Thank you

    Sanjit

  • Help, please... I need to know how to crop my video segments?  I also need to know how to make several clips to run at the same time by dividing the screens?  How to fade a clip?

    Help, please... I need to know how to crop my video segments?  I also need to know how to make several clips to run at the same time by dividing the screens?  How to fade a clip?

    I watched the video tutorials.  I need to know also how to add additional video tracks to my screen.  Any help please?

  • How to make a 3D layered model in an another 3D model?

    Hi all

    Always learn this program and I'm not even sure I used the name of the good object for what I'm doing...

    I am really confused, and I know that there must be a simple solution to what I'm trying to do.

    I made a model with a 2D image in 3D space to give the movement and then take this model in another comp to add some animated text that I can move between the layers. (FYI I use monkey type make a third part of the app and it creates its own camera etc.) The problem I have is when I bring the model into the new comp it does not bring the 2d to 3D image, so when I try to put the text between the two two layers it just goes behind the computer as if it was flat.

    The reason why I did it in a separate model is that its a picture of food that I've broken up, but if I try to scale or anything if I bring the image in 2D layers in the model of the text they scale but are now out of the training...

    How can long story short, I do a 2d/3d image move as a unit in a model when I move the image slightly apart along Z axes layers?

    I hope this makes sense...

    Please please help... !

    Thank you

    How to make a 3D layered model in an another 3D model?

  • How to make a link to open it in another window?

    How to make a link to open it in another window? I ticked the box in the hyperlink box, but nothing happens when I click on the link in the preview. The link works when I uncheck the box, but I want to open it in a separate window.

    Hello

    The link may not work in preview (when the option to open the link in a new tab is checked) however this will work if you do a file > preview page/site in the browser.

    Overview of Muse has only a single tab and impossible to open a tab/window, this is why this feature doesn't work in preview of Muse. but works in preview in the browser and in the published site.

    Kind regards
    Sachin

  • How to make Acrobat Professional 11.0 LICENSE to another PC

    How to make Acrobat Professional 11.0 LICENSE to another PC.

    Disable on A, install on B

    Learn how to enable or disable Adobe applications

    You install programs exactly in the same way you did the 1st time... Put your disc in the drive, and enter your serial number when asked

    .

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a way to go to a page to download the Adobe programs if you do not have a disk or drive

    -you will need to enter your original serial number during the installation for non-Cloud programs

    -Cloud desktop http://helpx.adobe.com/creative-cloud/help/creative-cloud-desktop.html

    -Cloud Getting Started https://helpx.adobe.com/creative-cloud.html

    -Membership questions and problems https://forums.adobe.com/thread/1146459

    - or kglad links in response to #1 here can help https://forums.adobe.com/thread/2081216

    Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq

  • Fill a field with a value only if another field has been filled?

    I'm looking to fill a field with a predetermined only if another field is not empty. I have no idea how to proceed.

    Any help would be appreciated.

    Thank you

    Use this code in the custom calculation of LineRow1 script:

    Event.Value = (this.getField("SourceDescriptionRow1").valueAsString == "")? « » : « 001 » ;

  • How do another field the value of a field in a form? As my image shows.

    Mr President.

    How do another field the value of a field in a form? As my image shows.

    I want that when a user enters the value credit then it also presents credit () 1.

    As below

    CREDIT.png

    concerning

    public void setCredit(String value) {
            setAttributeInternal(CREDIT, value);
      setCredit1(value);
    }
    

    Define autosubmit = true for the first column of credit.

    See you soon

    AJ

  • How to find scripts that run in the background

    Hey

    I'm looking for which scripts to run in the background

    Thank you

    Open the Task Manager and go to the Details tab. If a VBScript or JScript is running the wscript.exe or cscript.exe process appear in the list.

    Right-click on the column header and select 'Command Line'. That should tell you what script file is running.

Maybe you are looking for