Custom Script of Multiplication problem

I'm having a problem when I create a certain script multiplication where is just is not calculating correctly.  Its looks simple, but with my knowledge of scripts, I am unable to understand.  I read these forums and used a script that I found in another thread and it works for one of the calculations that I do, but then it does not work for another which does essentially the same thing.

So here's the scenario - I have a longer calculation of subtraction multiplication then back to the multiplication and the final multiplication script is the I can't work correctly even if I copied and pasted one (which works fine) and adjust the field values. I don't understand. The calc looks like this

Text 1

x 2 text

= Text 3

-Text 4

= Text 5

x 6 text

= Text 7

So, I have in the script customized for the first solution of multiplication.

Get the value of the field, as a number

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

Get the value of the field, as a number

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

Calculate and set the value of this field for the result

Event.Value = v1 * v2;

And in the solution of subtraction I

Get the value of the field

var v1 = getField("Text_3").value;

Get the value of the field

var v2 = getField("Text_4").value;

Set this field equal to the subtraction

Event.Value = v1 - v2;

And then I have in the final solution of multiplication

Get the value of the field, as a number

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

Get the value of the field, as a number

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

Calculate and set the value of this field for the result

Event.Value = v1 * v2;

I have been using the following numbers:

Text 1 = 417000

Text 2 = 0.25

Text 4 = 25000

Text 6 = 4

I received the following responses:

Text 3 = 104250 (correct)

5 text = 79250 (correct)

Text 7 = 417000 (incorrect; should be 317000)

Can someone help me?

You must pass in forms editing mode (forms > add or edit fields) and then select "forms > edit > set field calculation order of fields" and organize the list of the calculated fields in the logical order for your form.

Tags: Acrobat

Similar Questions

  • fdmContext in a custom script

    Hello everyone,

    I'm faced with a problem on a custom in FDMEE script.

    I have a custom jython script that calls an ODI scenario. My problem is how to move the POV selected in fdm to the ODI scenario? I need to get information from the period inside my ODI package.

    POV_Selected.PNG

    How can I achieve this?

    Thank you very much!!!

    Best regards

    Eduardo Almeida

    Your other question is that fdmContext will not be initialized in a custom script. If you need to get the FDMEE period in the scenario ODI, you must configure a custom script parameter that evaluates to FDMEE period POV as input that you can then recover in your script that is customized by using the following API - fdmAPI.getCustomScriptParameterValue ("ParameterName")

    You'd then this value as a variable argument to the ODI scenario

  • Need help with custom script to rename the layers

    Hello world.

    I need help to write a custom script (because I suck at it) that will allow me to go through all the layers and sous-calques for a specific name ('X') and give it a new specific name ('Y').

    I have had success using the script below, but it does not work on any text layers names where the text layer was previously particularly well-known in 'X' and now changed needs.

    Any help is greatly appreciated.

    * Note: this script was originally used to find any layer with 'Copy' in its name and remove with anything after (to correct the problem of duplication of layers by adding this text).

    This is why the function is named removeCopy. It works for renaming layers also - just not a layer of text unfortunately.

    #target illustrator

    function removeCopy() {}
    If (app.documents.length == 0) return;
    var app.activeDocument = docRef;
    recurseLayers (docRef.layers);
    }
    removeCopy();
    function recurseLayers (objArray) {}
    for (var i = 0; i < objArray.length; i ++) {}
    ObjArr [i] .name = ObjArr [i].name.replace (/ \s*current name\s*\d*/, 'new name');
    If (objArray [i] .layers) recurseLayers (. layers.length > 0 ObjArr [i]);
    }
    }

    I finally found something after searching forums for a week. My confusion was related to the way Illustrator treats real layers against text/path/object "layers." Instead of layers, I had to use the pageItems in the script. The code below works. Thanks to Gustavo for his answer in another thread and Carlos I thank you for this looking too good! You're great to be ready to help models do more advanced things with Illustrator.

    var doc = app.activeDocument;
    var items = doc.pageItems;
    for (var g = 0; g)
        elements [g] .name = elements [g].name.replace ('Century Schoolbook text line', ' MonogramText: Century Schoolbook ");
    };
    App.Redraw ();
  • Custom scripts does not work in Illustrator CC (2014)

    Some custom scripts that are part of my workflow do not work in the new CC; MultiExporter.jsx and Sprite CSS Generator.jsx.

    When I try to run is titled a modal window rises as if the script is running, but the actual window is only a few pixels maximum and cannot be resized.export-win.png

    sprite-gen-win.png

    They have both worked very well in CC. My scope of javascript is pretty basic, but is there code that needs to be changed to update these to work with the current version?

    Thank you!

    Bob

    It seems that this could be a system issue or a conflict; I uninstalled CC2013 AI and AI CC2014 so clearing out all the prefs, artifact files and folders. Then did a fresh install of CC2014 it has been able to use all my scripts inherited without problem.

  • multiple problems

    I use a desktop HP p7-1154 with Windows 7 computer.

    I'll have multiple problems but not stabilize those. Sometimes when I go on Internet Explorer, I get more than one copy of opening. Then, I sometimes get the message "Internet Explorer has stopped working" and will close. This will be repeated at the opening or while I'm online. Duplicates are also on the opening of different programs.

    Some photo programs that I use, breast different tools do not work. Program companies say that they have never heard of this problem, even after that I performed their suggestions.

    When someone plays games of cards on this HP sometimes when they click on a map several cards open, ruin this game.

    I ran Virus and Checkup, Spybot Search & Destroy to Norton, CC Cleaner, Malware Bytes and most of them said 'No problems a' I also do not have a system back Restore Point far enough away from using it.

    I'd appreciate any suggestions really.

    Most of the things have been resolved. We always get several cards when you play, but I can live with that. The Internet issue is corrected, which makes me very grateful...

    Alex

  • A custom step of multiple digital limit test | Hide the limit tab

    Hi all

    I am trying to create a custom step of multiple digital limit test. The custom step by itself poplulates the value of the limits of the measure. So I plan on Hide tab limits within the parameters of the step. Can someone guide me on how to do it?

    Thank you

    Prasaanthan

    Make sure that you have checked the box 'Show hidden properties' in the StationOptions > preferences. Otherwise, you will never find the table refers to erik.

    Norbert

  • Windows Vista/Defender telling me that I have multiple problems after update

    I use Windows Vista.  I've had problems since getting an update a few days ago.  Windows Defender is constantly telling me that I have multiple problems - if nothing has changed outside the Windows Update.  When I try to open my Convert (bought) the DVD program, it displays the message from the Red Cross stating that "Windows cannot access the specified device, path or file.  May not be the appropriate permissions for access you to them.  I should have all permissions on a computer at home.

    It would help if you gave the details of the messages you see Windows Defender.

    It could be that you have a fake antivirus infection similar to this:

    http://www.bleepingcomputer.com/virus-removal/remove-Windows-enterprise-Defender

    A symptom of this would be applications for payment activate the software.

  • My wife and my daughters both UAC accounts saying now that they have multiple problems and insufficient for memory.

    My son used my daughter and wifes UAC because I had his safety to tight to his liking. My wife and my daughters both UAC accounts saying now that they have multiple problems and insufficient for memory.  My UAC (admin) is fine. I opened his account and it's good? It seems to me that all UAC accounts would receive if it were a virus? My wife and my daughter lost all the photos and several icons on the desktop. The Help window opens automatically when you connect. The two seem to have lost the Explorer, I am at a loss. Any suggestions?

    Hello

    'insufficient memory' and hidden data

    If this is the case you can be infected

    read the error messages wrong than some malware product to try to rip you off at the link below

    read the information at the bottom of the below link to the subject of some malware that hide your data files and the cure for it regarding

    Read article 17

    http://www.bleepingcomputer.com/virus-removal/remove-Windows-Recovery

    also follow the correct for that malware removal steps, just to be safe, let's

    _______________________________________________________________

    otherwise, the foregoing:

    try a restore of the system before this happened

    http://www.windowsvistauserguide.com/system_restore.htm

    If necessary do in safe mode

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode option with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.
  • Error: Import module XLRD in a custom script FDMEE

    Hello Experts,

    I'm trying to import a python "xlrd" module in a custom Script FDMEE. But he doesn't always lift error "No Module name xlrd".

    I tried to import the module by changing the path sys:

    Here is the code I tried:

    ===========================================================================================

    import sys

    "custModlePath = r'fdmContext ["INBOXDIR"] +"\\Excel_Sample\\xlrd""

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\."

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out."

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    #data_sheet = book.sheet_by_index (3)

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\mapping.csv",'w")

    #myfile = open('SG\OUT\mapping.txt','w')

    all in start_row_count < end_row_count:

    #print data_sheet.row_values (i)

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =============================================================================================

    ERROR:

    2016-01-27 01:18:11, 294 FATAL [AIF]: error in CommProcess.executeCustomScript

    Traceback (most recent call changed):

    File "< string >", line 191, in executeCustomScript

    File '< string >", line 486, in executeCustomScript

    Folder "< string >", line 528, in executeJythonScript

    File "E:\FDMEE/data/scripts/custom/EXCEL_TO_CSV.py", line 6, < module >

    import xlrd

    ImportError: No module named xlrd

    2016-01-27 01:18:11, 336 DEBUG [AIF]: the connection of fdmAPI was closed.

    ===========================================================================================

    Appreciate your help!

    Thank you

    Ishti

    Hello

    I was able to get it working after some changes.

    Version compatible with Jython 2.5.1 FDMEE xlrd is xlrd 0.7.4

    Xlrd record is required to be placed inside the FDMEE server and the path is required to be updated in the script.

    Below the script just in case someone needs it:

    ===============================================================================================

    import sys

    custModlePath = fdmContext ["INBOXDIR"] + "\\Excel_Sample" # path in which is placed the folder xlrd

    sys. Path.Append (custModlePath)

    import xlrd

    path = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Mapping.xls" # path to the Source file

    pathout = fdmContext ["INBOXDIR"] + "\\Excel_Sample\\Out\\" # path to the .csv file

    Book = xlrd.open_workbook (path)

    data_sheet = book.sheet_by_name ("Report")

    start_row_count = 7

    end_row_count = data_sheet.nrows

    MyFile = open (pathout + "mapping.csv", "w" ")

    everything start_row_count<>

    lines = data_sheet.row_values (start_row_count)

    for the line data_sheet.row_values (start_row_count):

    MyFile.Write (STR (Line))

    MyFile.Write(",")

    MyFile.Write ("\n")

    start_row_count = start_row_count + 1

    MyFile.Close)

    =====================================================================================================

    Thank you

    Ishtique

  • Custom script in RPO making empty columns in the line items during the training.

    Hello friends,

    its URGENT! need help.

    We have a requirement of the company in the case of the currency 'EUR', it should delete the dot (.) and replace the comma (,) with dot (.) and other currencies it must remove the comma from columns, quantity, price per unit and Total.

    For example:

    For "EUR" 2.123,00 and it must convert it to 2123.00 and 2.123 must convert 2123.

    "USD" 2.123,00 to convert to 2.12300 and 2 123 to convert to 2123.

    This requirement, we wrote a custom script User Exit (UserExitLineItemValidate) function and call that function in line item validation.

    but after having formed the invoices for currency 'EUR' by supervised and learning check (SLV), it removes the values in the column quantity, unit price and Total.

    and if we remove the script, train and then reapply custom script it works but not always.

    My Script:

    Public Sub UserExitLineItemsValidate (pWorkdoc As SCBCdrPROJLib.SCBCdrWorkdoc, pValid As Boolean)

    ' User exit is called at the end of the Document_Validate on the class "bills".

    Dim strQuantity As String

    Dim strUnitPrice As String

    Dim strTotal As String

    Dim lngRow As Long

    Dim pTable As SCBCdrTable

    Set pTable = pWorkdoc.Fields ("LineItems"). Table (pWorkdoc.Fields("LineItems"). ActiveTableIndex)

    If fnIsVerifier and pWorkdoc.Fields ("Currency"). Text = "EUR" Then

    For lngRow = 0 To pTable.RowCount - 1


    strUnitPrice = pTable.CellText ("unit price", lngRow)

    If InStr (strUnitPrice, ".") > 0 and InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,".","")

    strUnitPrice = Replace(strUnitPrice,",",".")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    ElseIf InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,",",".")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    End If

    strTotal = pTable.CellText ('Total', lngRow)

    If InStr (strTotal, ".") > 0 and InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,".","")

    strTotal = Replace(strTotal,",",".")

    pTable.CellText ('Total', lngRow) = strTotal

    ElseIf InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,",",".")

    pTable.CellText ('Total', lngRow) = strTotal

    End If

    strQuantity = pTable.CellText ("quantity", lngRow)

    If InStr (strQuantity, ".") > 0 Then

    strQuantity = Replace(strQuantity,".","")

    End If

    If InStr (strQuantity, ",") > 0 Then

    strQuantity = Replace(strQuantity,",",".")

    End If

    pTable.CellText ("quantity", lngRow) = strQuantity

    Next LngRow

    On the other

    For lngRow = 0 To pTable.RowCount - 1

    strTotal = pTable.CellText ('Total', lngRow)

    If InStr (strTotal, ",") > 0 Then

    strTotal = Replace(strTotal,",","")

    pTable.CellText ('Total', lngRow) = strTotal

    End If

    strUnitPrice = pTable.CellText ("unit price", lngRow)

    If InStr (strUnitPrice, ",") > 0 Then

    strUnitPrice = Replace(strUnitPrice,",","")

    pTable.CellText ("unit price", lngRow) = strUnitPrice

    End If

    Next LngRow

    End If

    End Sub

    At a very high level of control, (and I can't currently that take a long time to respond)

    • You do this on EVERY invoice, and not only those that you are sub classification (which means "documents that you are training").  Is your intention to assign all invoices or only those formed?
    • In your code, you have the test as shown condition "If fnIsVerifier and pWorkdoc.Fields("Currency").» Text = "EUR" Then".»  You are in essence saying the system ONLY evaluate this condition if the system determines if the application Verifier is running.  What is the desired effect?  Otherwise if the auditor is never used on this document, and the table of line items is never changed, this code would never trigger.
  • CS6 is compatible with El Capitan? I have multiple problems, mainly with InDesign, that is broken, disappearing type elements, limited cancellations, low memory warnings. I would like to hear from someone representing Adobe on this.

    CS6 is compatible with El Capitan? I have multiple problems, mainly with InDesign, that is broken, disappearing type elements, limited cancellations, low memory warnings. I would like to hear from someone representing Adobe on this.

    Many people find such problems with CS6 in El Capitan. There will be no update for CS6, it has reached its end of life.

    You must go back to the previous version of the operating system, or upgrade to creative Clud.

  • To access the icons of InDesigns for custom scripts

    Hi all

    I think remember me a moment ago see a PDF file that had all the icons that uses InDesign and an access method and use them in my own custom scripts.

    I went through all my PDF resources which in have accumulated over the years and can't seem to find it. \

    Someone at - it a PDF file that contains this information, or resource online for this?

    Thank you very much


    Roy

    You can find a PDF catalog (Peter Kahrel site):

    Icon catalog

    Jarek

  • The payment change ADOBE info Web page fails - I can't scroll down to save the changes. My subscription is expired and I am dead in the water! I can't find a support customer portal to this problem - HELP PLEASE!

    I can't scroll down to save the changes. My subscription is expired and I am dead in the water! I can't find a support customer portal to this problem - HELP PLEASE!

    catsrock

    Great salvation,

    We are sorry for the inconvenience caused to you!

    I recommend you contact customer service regarding this issue.

    Kind regards

    Rahul

  • How can I create sequential shooting (1 for each 'row') numbers in a script in multiple column?

    How can I create sequential shooting (1 for each 'row') numbers in a script in multiple column?

    Sorry, but for now there no such function to put sequential numbers in the column number drawn.

  • Simple about how to use custom scripts?

    Y at - it plug-in or what that makes me a separate where window can I click just to use a custom script? Other easy ways are very good.

    In the tools had or has a free plug-in. I think it is called "script of Bay". He

    that's why and should work, I think that, with Illustrator.

    www.in-Tools.com

    Ariel

Maybe you are looking for