Simple Script to Calc custom, returning the odd value

Hi all

I'm not really familiar with Javascript and I'm checking here something simple.

----------

Event.Value = (this.getField("Applicant_1").value + this.getField("Bonuses").value + this.getField("Commissions").value + this.getField("Dividends_Interest").value + this.getField("Net_Rental_Income").value + this.getField("OtherBefore_1").value + this.getField("OtherBefore_10").value + this.getField("OtherBefore_4").value + this.getField("OtherBefore_7").value + this.getField("Overtime").value)

------


As long as I put a value in all the fields, it works very well. If I leave a field in the empty middle, my return value is really wide. By example, if I provide the value of '1' for overtime, bonuses and commissions, and leave the rest blank, my returned value will be 111.

Any help on this would be greatly appreciated. Thank you!

The reason for that is what happens when you get the value of an empty field, it returns an empty string. The operator '+' is used in JavaScript for digital addition and string concatenation, please make sure to ecxplicitly to convert the field value to numbers before adding them together. IF the script could be modified to:

(function () {}

Get the field values as numbers

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

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

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

var v4 = + getField("Dividends_Interest").value;

V5 var = + getField("Net_Rental_Income").value;

var V6 = + getField("OtherBefore_1").value;

v7 var = + getField("OtherBefore_10").value;

var V8 = + getField("OtherBefore_4").value;

var = v9 + getField("OtherBefore_7").value;

V10 var = + getField("Overtime").value;

Calculate the sum

Event.Value = v1 + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;

})();

Tags: Acrobat

Similar Questions

  • Returns the lowest value of two fields

    Hello

    I have two domains that users manually enter in a form.  Value1 and Value2.

    Someone at - it suggestions on the best way to use JavaScript to return the lowest value of the two fields?

    Thank you

    Natalie

    I think I misunderstood what you mean by any, I thought you wanted the calculated value to be None. The two fields value digital formats and modify the script for:

    Custom calculate script

    (function () {}

    Initialize the array

    aNums var = [];

    Get the field values as strings

    var s1 = getField("Value1").valueAsString;

    var S2 = getField("Value2").valueAsString;

    Convert values to numbers if not empty and add to the table

    If aNums.push(+s1) (s1);

    If aNums.push(+s2) (s2);

    Set the value of this lesser field of entries

    If both are blank, this field blank

    Event.Value = aNums.length? Math.min.Apply (null, aNums);:

    })();

  • Question of value Popup Lov key (description of the poster, returns the key value) by default

    Hello

    I have a Popup Lov key (description of the poster, returns the key value) and I want a default value. It is based on a list (user name, id).
    I tried to put the id of the user logged on as default, but what I see on the screen in the field is the value of the id, not the username.
    How can I pass the user id and see the user name?

    Thank you.

    Oh! My bad, I thought you are talking about regualt lOVs not popups.

    OK, so that's what you need to do, I tried it and it worked for me:

    your popup LOV > default > type: body of the PLSQL function > and enter a query like:

    declare
    UID number.
    Start
    Select user_id from the uid of the user
    where UPPER (username) = UPPER(:APP_USER);

    This should show username and retune userid.

    Hope this helps,

    Sam
    Please give good answers by marking correct or useful.

  • : Nom_element and V ('ITEM_NAME') do not return the same value

    Hi all

    I'm developing a shared application process that is called by an AJAX request.

    For the pl/sql code, stored procedure validation e development support I moved the logic inside a database.
    So I have this situation:

    Application process

    ...
    : MYITEM: = wwv_flow.g_x01; -received setting of ajax call I want to put
    ...
    MY_FUNCTION();

    MyFunc

    ...
    v('MYITEM') - here I use value MyItem
    ...

    The problem is that when I call v ('MYITEM') the value I get is the previous and not one that I put with: MYITEM: = wwv_flow.g_x01;
    I have the same problem if I set the V ('MYITEM') inside the apex application process.

    I saw that it worked right if I use the following to set the value of the element in the application process:

    APEX_UTIL. SET_SESSION_STATE('P0_LST_DATA',:P0_LST_DATA);

    Is this a bug?
    I was expecting to get the value of the item: MONELEMENT and v ('MYITEM') are equivalent...

    Thank you
    Davide

    Davide,

    If you encode the block like that, you should get the results you expect:

    : P100_VAR1: = '1'. : P100_VAR1;
    : P100_TEST: =: P100_VAR1;

    The reason why this block does not give you what you expect:

    : P100_VAR1: = '1'. : P100_VAR1;
    : P100_TEST: = v ('P100_VAR1');

    ... is that v ('P100_VAR1') returns the current value of the item in the table of PL/SQL State session as it existed before the execution of the block. The assignment to the variable binding: P100_VAR1 has registered only a value in storage variable to bind the dynamic execution at this time and has not yet spread to session state, which is located at the end of the execution of the block. It's a little weird, we know.

    Andy,

    I figured that the: xxxx points have been settled during the loading of the page with what the source is...

    They contain the session state value and can be read or written in notation variable bind.

    However, they are updated only in the session when you send page...

    They are updated in session state when the particular block is completed and a commit is issued at this time there.

    In order to update a piece of code PL/SQL session state, you must use... apex_util.set_session_state.

    You must be careful to call it when scoring also bind variable to set the session state may cause one to deny the other. Using one method or the other should work very well.

    Scott

  • Confidence for app.newDoc function always returns the undefined value

    Hello

    I'm doing a script activated by button.  Its purpose is to save a copy of the first page (form data erasure) in its own file in the same path as the open document.  As part of that I had to create a trust to cover the privileges of the app.newDoc function.  I have the following:

    trustedNewDoc = app.trustedFunction (function (nWidth, nHeight)

    {

    app.beginPriv ();

    app.newDoc (nWidth, nHeight);

    app.endPriv ();

    });

    This was recorded in a file called "newdoc.js" in the "app" of javascript.  I closed my Acrobat Pro XI and restarted.  As soon as I try to activate a button with just: "myDoc = trustedNewDoc var (500,500);", it opens the document as specified, but I get "undefined" returned to myDoc - that avoids manipulation of the Fryer.

    If I run the same line of the console, it also returns the value undefined.  Running "myDoc = var app.newDoc ();" also returns undefined, but just "app.newDoc ()"; only returns '[Doc]' - even if ' trustedNewDoc (500,500); "alone is still undefined.

    In any case, I feel like I'm missing something fundamental, even if I found some guides suggesting to do exactly what I have it implemented.  I am pretty sure I have everything entered correctly and followed all the steps, so at this point I'm stumped.  Any help would be greatly appreciated!

    Thank you

    Mike

    Thanks Gilad, that was exactly what he needed!  And thanks for getting back to me so quickly.  Now, I really wish I would have asked this question more early yesterday after spending hours trying to find a solution.

    Unfortunately there aren't really examples I found where a value was returned.  Maybe it's the good sense and I should have better, but I thought that the value has been returned by other means.  In any case, it's great to work with your help!  Now, I have a separate question, with what I need to see if I can get help. Hey, great work and thank you again!

  • Need a script for a replacement of the bound value

    Here's the scenario, I'm creating a cover letter for citations which has two instances of the name of the customer. The first instance is the address at the top of the letter and the second is in the last line of a paragraph. My problem is I want to link the fields, but adding a period to the next, but in cases where the company name ends in a period (EX: 'Monsters, Inc.') I don't need period. My thought is to retain a format script that adds the period, but add an if(ends.with".") Statement of the above situation. I'm kinda new to js so I could really use help sort this out.

    The field name is "company name".

    Name the second field 'Company name2' and use this computer code custom for her:

    var CNAME = this.getField("Company_Name").value;

    If (cname =="") {}

    Event.Value = "";

    } else {}

    If (/ \.$/.test(cname)) event.value = cname;

    else event.value = cname + '. ';

    }

  • How to return the highest value in a column of numbers less than a given number

    I am a beginner using formulas in number.  I have an inventory in a Numbers spreadsheet (v3.6.2).  Inventory numbers are in a column.  I need to view the last number used or the highest number less than a given value.  In my case, it is 9000.

    I can put a cell to return MAX and it's cool, but I need to know the number < 9000, MAX.

    Hi JS.

    SEARCH is your friend here. One of the properties of the LOOKUP function is that it accepts a 'close-match', which is defined as the largest value less than or equal to the search value.

    Formulas:

    A2: LOOKUP (8999.9999999, D)

    B2: LOOKUP(9000,D)

    C2: MAX (D)

    Kind regards

    Barry

  • NotificationsDialog returns the same value for the two buttons

    I have a NotificationsDialog with two SystemUiButtons, now when I click on buttons and console the result they both return the number two, I don't really understand why.

    {NotificationDialog}
    ID: alertdialog
    Title: "Alarm" - + alarmTime
    body: Setting.get ("alarmCompletedMessage")
    repeat: true
                
                    
    buttons:]
    {SystemUiButton}
    label: "Stop".
    },
    {SystemUiButton}
    label: "Snooze."
    }
    ]
    onFinished: {}
    Console.log ('result' + result)
    Console.log (Error)
    }
    }

    Is there a better way to identify which button has been activated?

    Wish a little, she supported confirm and Cancel buttons, or SystemUIButtons have their own onClicked properties

    Thank you

    Use buttonSelection () instead of the result .label

  • PersistentStore.getPersistentObject returns the null value?

    I use a random key to retrieve a shape of the object PersistentStore

    persist is PersistentStore.getPersistentObject (KEY);.

    Works fine on the Simulator (OS 5), when I take the code signed to the device (BB OS 5.0 Bold 8900)

    For some reason, it returns null, without exception. Thereafter any API I inoke on PersistentStore / persist returns null without exception persist even when the null value.

    I don't know if it's one thing to eclipse debugger, but even if the debugger shows that objects are null. Controls null applied in the code seems to fail, what does code see these objects as non-null. Pheww! How is it possible.

    In this code still shows up as null, then safetyTable and orderedkeys. However, the value null check in the failure code.

    At a later stage in the code, when I try to access orderedkeys are null again! Are struggling with this problem for two days, all the pointers would be very comfortable.

                        persist = PersistentStore.getPersistentObject( KEY );
                        persistOrderedKeys = PersistentStore.getPersistentObject(KEY_ORDERED_KEYS);
                        safetyTable = (Hashtable)persist.getContents();
                        orderedKeys = (Vector)persistOrderedKeys.getContents();
                        if (safetyTable == null)
                        {
                            safetyTable = new Hashtable();
    
                            persist.setContents(safetyTable);
                            persist.commit();
                        }
    
                        if (orderedKeys==null)
                        {
                            orderedKeys=new Vector();
    
                            if (safetyTable.size()>0)
                            {
                                Enumeration addressKeys = safetyTable.keys();
                                while(addressKeys.hasMoreElements())
                                {
                                    orderedKeys.addElement((String)addressKeys.nextElement());
                                }
                            }
                            persistOrderedKeys.setContents(orderedKeys);
                            persistOrderedKeys.commit();
    
                        }
    

    "I don't know if it's one thing to eclipse debugger.

    I had problems of this kind when I don't have a level of operating system for the device I am debugging on.

  • Returns the time value zero calendar

    Hi, I write code with calendar that return the value zero for HOUR_OF_DAY and MINUTE when I run this code in Strom2(9550-5.0.0.334) below.

    Calendar calendar = Calendar.GetInstance ();
    Date date = new Date (this.arrivalTimeField.getDate ());
    calendar.setTime (date);
    Day int = calendar.get (Calendar.HOUR_OF_DAY);
    int minute = calendar.get (Calendar.MINUTE);

    So please help me for this problem and thanks in advanced

    I had a lot of problems like myself.  Invariably, I find that the bug is my code.  Usually, it is not difficult to find using the appropriate debug or SimpleDateFormat (because times are difficult to interpret, it is good to let the system do it for you!).  I suggest you do the same thing here.

    If you find that the system does not have it that you wait, then give us the details, for example, give us the long value that you provide to the calendar and the time you go out. You should be able to do it in two or three lines, just using the standard Java RIM (i.e. None of your classes).  You can also indicate the time zone that you are testing in.

  • HypGetMemberInformation in VBA. Does not return the property values.

    I tried to use HypGetMemberInformation in VBA to find the level of a member of the grid.

    I continued to get zeros even for members who are not level 0 ones.

    I went to test HypGetMemberInformation a test connected grid that has members in the first column (column A).

    I packed a test routine I ran after you connect the grid manually:

    Void TestMemberLevelFind()

    Dim line As Integer

    Dim MemberProperties Collection As

    Dim vtMemberName As String

    ' Dim vtPropertyName As String

    Dim vtPropertyValue As Long

    Dim vtPropertyValueString As String

    Dim ErrorCode as long

    Dim ErrorMessage As String

    Define MemberProperties = new Collection

    MemberProperties.Add HYP_MI_NAME

    MemberProperties.Add HYP_MI_DIM

    MemberProperties.Add HYP_MI_LEVEL

    MemberProperties.Add HYP_MI_GENERATION

    MemberProperties.Add HYP_MI_PARENT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CHILD_MEMBER_NAME

    MemberProperties.Add HYP_MI_PREVIOUS_MEMBER_NAME

    MemberProperties.Add HYP_MI_NEXT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CONSOLIDATION

    MemberProperties.Add HYP_MI_IS_TWO_PASS_CAL_MEMBER

    MemberProperties.Add HYP_MI_IS_EXPENSE_MEMBER

    MemberProperties.Add HYP_MI_CURRENCY_CONVERSION_TYPE

    MemberProperties.Add HYP_MI_CURRENCY_CATEGORY

    MemberProperties.Add HYP_MI_TIME_BALANCE_OPTION

    MemberProperties.Add HYP_MI_TIME_BALANCE_SKIP_OPTION

    MemberProperties.Add HYP_MI_SHARE_OPTION

    MemberProperties.Add HYP_MI_STORAGE_CATEGORY

    MemberProperties.Add HYP_MI_CHILD_COUNT

    MemberProperties.Add HYP_MI_ATTRIBUTED

    MemberProperties.Add HYP_MI_RELATIONAL_DESCENDANT_PRESENT

    MemberProperties.Add HYP_MI_RELATIONAL_PARTITION_ENABLED

    MemberProperties.Add HYP_MI_DEFAULT_ALIAS

    MemberProperties.Add HYP_MI_HIERARCHY_TYPE

    MemberProperties.Add HYP_MI_DIM_SOLVE_ORDER

    MemberProperties.Add HYP_MI_IS_DUPLICATE_NAME

    MemberProperties.Add HYP_MI_UNIQUE_NAME

    MemberProperties.Add HYP_MI_ORIGINAL_MEMBER

    MemberProperties.Add HYP_MI_IS_FLOW_TYPE

    MemberProperties.Add HYP_MI_AGGREGATE_LEVEL

    MemberProperties.Add HYP_MI_FORMAT_STRING

    MemberProperties.Add HYP_MI_ATTRIBUTE_DIMENSIONS

    MemberProperties.Add HYP_MI_ATTRIBUTE_MEMBERS

    MemberProperties.Add HYP_MI_ATTRIBUTE_TYPES

    MemberProperties.Add HYP_MI_ALIAS_NAMES

    MemberProperties.Add HYP_MI_ALIAS_TABLES

    MemberProperties.Add HYP_MI_FORMULA

    MemberProperties.Add HYP_MI_COMMENT

    MemberProperties.Add HYP_MI_LAST_FORMULA

    MemberProperties.Add HYP_MI_UDAS

    ' For line 8 to 83 =

    For row = 8-10

    vtMemberName = ThisWorkbook.ActiveSheet.Cells (rank 1). Value

    For each vtPropertyName in MemberProperties

    Code of error = HypGetMemberInformation(ThisWorkbook.ActiveSheet.Name, vtMemberName, vtPropertyName, vtPropertyValue, vtPropertyValueString)

    If ErrorCode = 0 Then

    MsgBox _

    "The worksheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property value:" & vtPropertyValue & Chr (13) & _ "."

    "The property string:" & vtPropertyValueString ".

    On the other

    ErrorMessage = GetReturnCodeMessage (ErrorCode)

    MsgBox "SmartView API function HypGetMemberInformation returned an error message:" & Chr (13) & ErrorMessage, vbOKOnly, PrivateConnectionDescription

    End If

    Next

    On the next row

    End Sub

    The routine produces no result expected.

    Only of zeros.

    For all properties and all members.

    There must be something fundamentally wrong with my code.

    The function arguments are correct with regard to the name of journal, the member name and property name.

    Value of the property is always 0 and the property value string is always empty.

    Two property value arguments are expected to be passed by reference, so I should get some useful information.

    No error is generated so that the return error code is always 0.

    I guess that some prerequisite so that this function is not satisfied, but what is?

    Concerning

    Problem solved.

    The cause of all evil, as ususal, type mismatch...

    Arguments by reference:

    vtPropertyValue, vtPropertyValueString

    must be declared as variants but returned it to the values are ARRAYS...

    After the function call, to loop through these berries extract the real info returned!

    In the case of unique value of parameters such as the level of Member just use index 0, for example:

    vtPropertyValue (0)

    The corrected code is less with parts modified trhe parked in Green:

    Void TestMemberLevelFind()

    Dim line As Integer

    Dim index As Integer

    Dim MemberProperties Collection As

    Dim vtMemberName As String

    Dim vtPropertyName As Variant

    Dim vtPropertyValue As Variant

    Dim vtPropertyValueString As Variant

    Dim ErrorCode as long

    Dim ErrorMessage As String

    Define MemberProperties = new Collection

    MemberProperties.Add HYP_MI_NAME

    MemberProperties.Add HYP_MI_DIM

    MemberProperties.Add HYP_MI_LEVEL

    MemberProperties.Add HYP_MI_GENERATION

    MemberProperties.Add HYP_MI_PARENT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CHILD_MEMBER_NAME

    MemberProperties.Add HYP_MI_PREVIOUS_MEMBER_NAME

    MemberProperties.Add HYP_MI_NEXT_MEMBER_NAME

    MemberProperties.Add HYP_MI_CONSOLIDATION

    MemberProperties.Add HYP_MI_IS_TWO_PASS_CAL_MEMBER

    MemberProperties.Add HYP_MI_IS_EXPENSE_MEMBER

    MemberProperties.Add HYP_MI_CURRENCY_CONVERSION_TYPE

    MemberProperties.Add HYP_MI_CURRENCY_CATEGORY

    MemberProperties.Add HYP_MI_TIME_BALANCE_OPTION

    MemberProperties.Add HYP_MI_TIME_BALANCE_SKIP_OPTION

    MemberProperties.Add HYP_MI_SHARE_OPTION

    MemberProperties.Add HYP_MI_STORAGE_CATEGORY

    MemberProperties.Add HYP_MI_CHILD_COUNT

    MemberProperties.Add HYP_MI_ATTRIBUTED

    MemberProperties.Add HYP_MI_RELATIONAL_DESCENDANT_PRESENT

    MemberProperties.Add HYP_MI_RELATIONAL_PARTITION_ENABLED

    MemberProperties.Add HYP_MI_DEFAULT_ALIAS

    MemberProperties.Add HYP_MI_HIERARCHY_TYPE

    MemberProperties.Add HYP_MI_DIM_SOLVE_ORDER

    MemberProperties.Add HYP_MI_IS_DUPLICATE_NAME

    MemberProperties.Add HYP_MI_UNIQUE_NAME

    MemberProperties.Add HYP_MI_ORIGINAL_MEMBER

    MemberProperties.Add HYP_MI_IS_FLOW_TYPE

    MemberProperties.Add HYP_MI_AGGREGATE_LEVEL

    MemberProperties.Add HYP_MI_FORMAT_STRING

    MemberProperties.Add HYP_MI_ATTRIBUTE_DIMENSIONS

    MemberProperties.Add HYP_MI_ATTRIBUTE_MEMBERS

    MemberProperties.Add HYP_MI_ATTRIBUTE_TYPES

    MemberProperties.Add HYP_MI_ALIAS_NAMES

    MemberProperties.Add HYP_MI_ALIAS_TABLES

    MemberProperties.Add HYP_MI_FORMULA

    MemberProperties.Add HYP_MI_COMMENT

    MemberProperties.Add HYP_MI_LAST_FORMULA

    MemberProperties.Add HYP_MI_UDAS

    ' For line 8 to 83 =

    For row = 8-10

    vtMemberName = ThisWorkbook.ActiveSheet.Cells (rank 1). Value

    For each vtPropertyName in MemberProperties

    Code of error = HypGetMemberInformation (ThisWorkbook.ActiveSheet.Name, vtMemberName, vtPropertyName, vtPropertyValue, vtPropertyValueString)

    If ErrorCode = 0 Then

    If IsArray (vtPropertyValue) then

    For index = LBound (vtPropertyValue) to UBound (vtPropertyValue)

    MsgBox _

    "The sheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property" & index & "value table:" & vtPropertyValue (index) & Chr (13) & _

    "Property" & index & "string array:" & vtPropertyValueString (index)

    Next

    On the other

    MsgBox _

    "The sheet name:" & ThisWorkbook.ActiveSheet.Name & Chr (13) & _ "."

    "Member name:" & vtMemberName & Chr (13) & _ "."

    "Property type:" & vtPropertyName & Chr (13) & _ "."

    "Property value:" & vtPropertyValue & Chr (13) & _ "

    "The property string:"& vtPropertyValueString"

    End If

    On the other

    ErrorMessage = GetReturnCodeMessage (ErrorCode)

    MsgBox "SmartView API function HypGetMemberInformation returned an error message:" & Chr (13) & ErrorMessage, vbOKOnly, PrivateConnectionDescription

    End If

    Next

    On the next row

    End Sub

    Fortunately we can someone find this useful.

    I wish documentation Oracle was a little clearer with more extensive code examples.

    Gustaw

  • GetCurrentRow returns the null value while trying to values defined in table advanced VO

    Hi all

    I'm trying to set default values to a bean advanced table according to the selection of LOV in another region. Here is the code and getCurrentRow returns the value null and null pointer exception is throwed. Please let me know where Iam going bad.

       if (pageContext. ) isLovEvent ())

    LovInputSourceId = string pageContext. getLovInputSourceId ();

       if ("poNumber". ) is equal to ()lovInputSourceId))

    pageContext . putDialogMessage (new OAException()"inside Onclick"));

    OAViewObject VO = (OAViewObject) am . findViewObject ()"L3APNonprojbasedpoVO1");

    VO1 OAViewObject = (OAViewObject) am . findViewObject ()"L3APCodingInfoEOVO1");

      VO . setWhereClause (null);

      VO . setWhereClauseParams (null);

      VO . executeQuery ();

      VO1 . setWhereClause (null);

      VO1 . setWhereClauseParams (null);

      VO1 . setWhereClause ("1=2");

      VO1 . executeQuery ();

       if (null! = VO )

       Row ReqRow = (Row) VO.first();  

       if (null ! = ReqRow )

       int idx = VO . getRowCount ();

       for (int xx = 0; xx < idx ; xx ++)

    String Description = (String)VO. getCurrentRow (). getAttribute ()"ItemDescription");

       Number Amount = (Number)VO. getCurrentRow (). getAttribute ("Amount");

       String Company = (String)VO. getCurrentRow (). getAttribute ("Company");

    String ProfitCenter = (String)VO. getCurrentRow (). getAttribute ()'ProfitCenter');

       String Dept = (String)VO. getCurrentRow (). getAttribute ("Dept");

       String Lob = (String)VO. getCurrentRow (). getAttribute ("Lob");

       String Account = (String)VO. getCurrentRow (). getAttribute ("Account");

    pageContext . putDialogMessage (new OAException()"inside loops'));

       if (null! = VO1 )

      { am. invokeMethod ("createRow");

    VO1 . getCurrentRow (). setAttribute ()'Description',Description);

      VO1 . getCurrentRow (). setAttribute ("Amount",Amount);

      VO1 . getCurrentRow (). setAttribute ("Company",Company);

      } ReqRow = (Row)VO.next(); }

       else {}

    }

    }

    Here is the method in AM.

    Public Sub createRow()
    {

    OAViewObject vo = (OAViewObject) getL3APCodingProjectEOVO1 ();

    vo.clearCache ();

    If (!) VO.isPreparedForExecution ())
    {
    System.out.println ("project VO executed");
    vo.setWhereClause (null);
    vo.setWhereClauseParams (null);
    vo.setWhereClause ("1 = 2");
    vo.executeQuery ();
    }
    Line = vo.createRow ();
    vo.insertRow (row);
    row.setNewRowState (Row.STATUS_INITIALIZED);

    }

    I modified your code a bit. This code does not require a method of AM.

    If the problem still not solved.

    If you want you can try this and let us know what happens.

    if (pageContext.isLovEvent())
    {
       String lovInputSourceId = pageContext.getLovInputSourceId();
       if("poNumber".equals(lovInputSourceId))
      {
      pageContext.putDialogMessage(new OAException("Inside Onclick"));
      OAViewObject VO=(OAViewObject)am.findViewObject("L3APNonprojbasedpoVO1");
      OAViewObject VO1=(OAViewObject)am.findViewObject("L3APCodingInfoEOVO1");
      VO.setWhereClause(null);
      VO.setWhereClauseParams(null);
      VO.executeQuery();
    
      VO1.setWhereClause(null);
      VO1.setWhereClauseParams(null);
      VO1.setWhereClause("1=2");
      VO1.executeQuery();
    
      if (VO != null)
      {
      for( Row ReqRow = (Row) VO.first();  ReqRow != null; ReqRow = (Row) VO.next())
      {
      String Description = (String)ReqRow.getAttribute("ItemDescription");
      Number Amount = (Number)ReqRow.getAttribute("Amount");
      String Company = (String)ReqRow.getAttribute("Company");
      String ProfitCenter = (String)ReqRow.getAttribute("ProfitCenter");
      String Dept = (String)ReqRow.getAttribute("Dept");
      String Lob = (String)ReqRow.getAttribute("Lob");
      String Account = (String)ReqRow.getAttribute("Account");
      pageContext.putDialogMessage(new OAException("Inside for Loop"));
    
      if (VO1 != null)
      {
      Row newRow  = VO1.createRow();
      newRow.setAttribute("Description",Description);
      newRow.setAttribute("Amount",Amount);
      newRow.setAttribute("Company",Company);
      VO1.insertRow(newRow);
      }
      }
      }
      }
    }
    

    See you soon

    AJ

  • set_item_property changing the text, but how to return the original value

    Hi all
    I use Oracle Forms Builder 10 gr 2 / I have the following problem: in a button I trigger when it is pressed. And then I change a few elements prompt text. But my problem is how to return the original prompt text. A kind of refresh or clear?


    Here is a piece of code that modifies the prompt text:
    set_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', PROMPT_TEXT, get_item_property('XXBG_CE_STATEMENT_LINES_NEW.AGENT_NO', prompt_text) || '*');
    Thanks in advance,
    Bahchevanov.

    This is not tested, but it's something like this:

    declare
       v_item  varchar2(200);
    begin
       v_item := get_block_property('block',first_item);
       loop
          exit when v_item = 'block.'||null;
          set_item_property(...);
          v_item := 'block.'||get_item_property(v_item,nextitem );
       end loop;
    end;
    
  • Function does not return the correct value

    Hi, I'm having a strange problem and hope someone knows how to solve this problem...

    I try to send a string to a function in another class and do return to a textfield, so I can add it to a movieclip and on the stage. I use it for several buttons. The problem is when I put that a string in it value returns a string for the previous call to the function that is not the string value that I want to use. Here's the function:

    public void replaceMCTxt (mcString:String, xPos:Number,

    yPos:Number, rolloverText:Boolean, newFontSize:uint, height: uint, width: uint = false): {TextField

    var newMCTxt:TextField = new TextField();

    newMCTxt.x = xPos;

    newMCTxt.y = yPos;

    newMCTxt.width = width;

    newMCTxt.height = Height;

    var textFormat:TextFormat = new TextFormat();

    textFormat.align = _gameModel.screenFontAlign;

    textFormat.size = newFontSize;

    textFormat.font = _gameModel.screenFont;

    textFormat.color = _gameModel.screenFontColor;

    newMCTxt.defaultTextFormat = textFormat;

    newMCTxt.text = _languageClass.getTranslation (mcString);

    newMCTxt.selectable = false;

    Return newMCTxt;

    }

    I try to call with this statement in another class:

    _moreGamesTxtField = _updateLanguageClass.

    ("MORE GAMES", _gameModel.moreGamesTxtXPos, replaceMCTxt

    _gameModel.moreGamesTxtYPos, _gameModel.moreGamesTxtWidth,

    (_gameModel.moreGamesTxtHeight, _gameModel.moreGamesTxtFontSize);

    Instead of giving me a movieclip "MORE GAMES", it gives me a 'PLAY' movieclip, which is what the previous call to the function used. I also had a similar problem in another function where he did the same thing with filtering of different buttons, so I think the problem is in the service, but I'm not programmer to know that it's good enough. If anyone has an idea please let me know. Thank you...

    Start the survey using the trace() function to see what value is passed to and returned by some _languageClass.getTranslation ().

  • To access the bindItems returns the undefined value

    Hello

    I'm trying to access the string representing the expression SOM associated with dynamic properties for a drop-down list by using script.

    Looking at the xml source I see the bindItems element with attributes in ref, labelRef and valueRef.

    I thought I'd try to access these values for a particular DropDown in the script editor would be:

    DropDown.bindItems.ref

    or something similar, but an exception is thrown that DropDown.bindItems is not defined.

    Any help would be greatly appreciated.

    Thank you.

    Kyle

    Hi Kyle,.

    I don't know what is the boss, some seem to work some don't. But you can work around it by using one of the following methods.

    . REF DropDown ["#bindItems"]

    DropDown.resolveNode('#bindItems').ref

    Good luck

    Bruce

Maybe you are looking for