Dynamically Update a number field by summing of page item values.

Hi,
I'm trying to update a number field on an apex page by summing up the values of multiple page items. I've tried to follow this tutorial http://st-curriculum.oracle.com/obe/db/apex/r40/apexdynactions/apexdynactions_ll.htm , especially the "Create a Set Value Dynamic Action Using PL/SQL" part.
In the tutorial example they return an page item value P3_SAL multiplied by a multiplier they've determined by another page item's case. What I want to do is much simpler in that I just want to add up multiple page item values and then display them in a number field at the bottom of the page.
so the code I tried to use based on the tutorial is in the tab: Home >Application Builder>Application 103>Page 3>Edit Dynamic Action>Create / Edit Action
Set Type: PL/SQL Function Body
PL/SQL Function Body:
BEGIN
return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
END;
Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3
But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.
ie.
BEGIN
return :P3_ITEM1+1000;
END;
Any help would be appreciated.

PL/SQL Function Body:
BEGIN
return :P3_ITEM1+P3_ITEM2+P3_ITEM3;
END;
Page Items to Submit: P3_ITEM1,P3_ITEM2,P3_ITEM3
But it gives me an error that I need to declare the identifiers, yet it works if I only use one item and I can perform any arithmetic.In your code is missing the ":" for the items P3_ITEM2 and P3_ITEM3.
Try this:
BEGIN
return :P3_ITEM1+:P3_ITEM2+:P3_ITEM3;
END;

Similar Messages

  • Dynamic alignment of report column and page item value

    Hi friends,
    I have an interactive report which contains the columns like
    <li>empno
    <li>Name
    In the above i have "empno" with a column alignment of left and a "Name" with a column alignment of left.
    Whether it is possible to override the data alignment that we set in the report according to the value of the application item like
    If my application item value is US, then i need the column alignment of both the column"empno" and "Name" to be left and if my application item value is AR, then i need the column alignment of both the column "empno" and "Name" to be right. Whether is it possible to achieve the dynamic alignment to the report data of both the columns "empno" and "Name" according to the application page item value.
    And also in the case of page item i have a page item with a name P1_NAME in which it has a Element Horizontal/Vertical alignment to left.
    I need that element alignment of the page item to behave dynamically according to the application page item, like if the application page item is US then the element alignment of the page item has to be left and if the application page item is AR then the element alignment of the page item has to be right.
    Whether is it possible to achieve my above two scenario's friends. Kindly help me with this.
    Thanks in advance.
    Brgds,
    Mini

    Kees,
    Your approach is excellent and brilliant:-)
    I tried with your steps and i can achieve those alignment in both ways like you said(either on page load/through DA).
    But im going with the DA way. I have certain query regarding this kees.
    <li>Suppose if the report, is classic whether i can go with the same approach that i have achieved alignment with the IR report.
    <li>Currently through the DA way, i used the page item in the condition. Is it possible to use the application item instead of page item in DA. Because im going to use the application item FSP_LANGUAGE_PREFERENCE for getting the code either 'AR' or 'US'.
    <li>Finally i need this kind of restriction for the page item also, consider like i have a page item P1_X with an Element Vertical/Horizontal alignment as left. Now i need to change that alignment to right according to the application page item value, hence i can give application item condition for the page item like below
    PL-SQL EXPRESSION: :FSP_LANGUAGE_PREFERENCE = 'AR'
    i need the element alignment of the page item to behave dynamically suppose if the application item value is AR then the element alignment of that page item has to be right if the application item value is US then the element alignment of that page item has to be left, irrespective of the page item Element Vertical/Horizontal alignment that was set to it.
    Thanks for your kind help
    Brgds,
    Mini

  • Dynamic updates in dropdown field using presentation

    My requirement is as follows:
    1)     Combination of text box & dropdown in the presentation.
    2)     Dropdown is dependent on the text box.
    3)     If user will enter the two characters in the text box then automatically drop down will be fill the list of the string(s) starting with entered 2 characters.
    Ex:
    In side text box I entered “GO”.
    In the drop down it should populated with list of cities start with “GO”.
    Please let me know if any one having the solution satisfying above requirement.
    With Best Regards,
    Ratna Prasad,

    Hi,
    <div class="jive-quote"><span class="jive-quote-header">user11180317 wrote:
    I enter any text in the textbox and according to that i execute the query which is in the dynamic method of the referenced data of the drop down but nothing happens.So i called another method on change invoke having the refreshvalidvalues command then also nothing happened.</div>
    A few ideas when testing this.
    1. Double check your textbox that is supposed to update the attribute shown in the dropdown. Look at the textbox's Properties and verify that there is an "On change invoke" method associated with the field.
    2. Open the method referenced in the first step. The method should have the logic:
    logMessage "refreshing valid values" using severity = DEBUG
    refreshValidValues("theNameOfTheAttributeInTheDropdown")A common problem is when you leave the double quotes out of this logic (e.g. refreshValidValues(theNameOfTheAttributeInTheDropdown) will not work)
    3. Double check the attribute that you want to update dynamically. In the above step, the attribute's name is "theNameOfTheAttributeInTheDropdown". Open this attribute now and verify that in the Valid Values section for the attribute - there is a Dynamic method invoked that updates the permitted values for this attribute (and therefore the values shown in the dropdown).
    4. Open the method that updates the attribute's valid values dynamically (method found in step 3) and add a logMessage statement at the top like:
    logMessage "Entry - valid values update for attribute theNameOfTheAttributeInTheDropdown" using severity = DEBUGAfter the valid values have been retrieved, show this list using another logMessage statement in this method.
    5. Run the screenflow again from the WorkSpace and verify that dropdown is getting populated. If not - check the log file for the point of failure.
    Hope this helps,
    Dan

  • STARVC - is there a way to update the NUMB field?

    Hi Experts,
    Easy question, but I can't find the answer.
    I know how to use STARVC, and I enter a new value as a parameter, provide a name, and fill in the LOW field.  But the NUMB field is ALWAYS 0000.  I want to make it a 0001.
    SM30 is out of the question as it isn't available in our prod environment. 
    Is there a way?

    Hi
    When you enter it as Parameter, the numb field is always 0000 as it is one to one relation between name and value i.e.
    for one name you can assign one value.
    If you enter it as select-options then in multiple selection this NUMB increases by 1 starting from 0000.
    Br,
    Nikhil

  • BUG: Sorting drop-down lists from the field tab when using "specify item values"

    Hi all,
    I've finished creating my form now, but I came across this whilst writing up my documentation for maintenance tasks.
    This occurs when adding new values to a drop-down list that has the "Specify item values" checkbox in the binding tab checked.
    When I then try to sort my list using the built in sort buttons, it will sort the items, but the list of specified values in the binding tab does not sort reorder to stay with the original items in the list.  This is hapenning when I sort from the Object > Field tab.  If I sort in the Object > Binding tab then the sort will include the specified values.
    For example:
    A    5
    C    2
    D    9
    Add a new value to get:
    A    5
    C    2
    D    9
    B    10
    Sort the list using the button:
    A    5
    B    2
    C    9
    D    10
    But it should be:
    A     5
    B     10
    C     2
    D     9

    I was able to duplicate this problem and it looks like a possible bug.  I've submitted it to support.

  • Problem with dynamic change a page item value

    Hi,
    I'm trying to dynamically calculated the value of an item based on a simple formula that involves the multiplication of two elements from the same page.
    To do this, create dynamic action as follows:
    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: SQL Statement
    SQL Statement: SELECT :P19_DURATION * :P19_RATE FROM DUAL
    Page items to submit: P19_DURATION
    Selection Type: Item(s)
    Item(s): P19_AMOUNT
    When altering the P19_DURATION get no change in P19_AMOUNT
    Since my knowledge of javascript is almost zero, I'm trying to do this with pl / sql or sql. Try the dynamic action with a function or a PL / SQL statement and nothing works.
    Have to use javascript for this?
    Searching the forum I think it's something simple, but I did not find an example similar to what I need.
    Regards

    Event: Change
    Selection Type: Item(s)
    Item(s): P19_DURATION
    Action: Set value
    Fire on page load: TRUE
    Set Type: javascript
    javascript Code:
    amount = $v('P19_DURATION') *  $v('P19_RATE');
    $s('P19_AMOUNT',amount);

  • List item with user and/or department field linked + dynamic update of department field

    Hi all,
    I've the mission to create a Sharepoint 2010 list to manage our IT assets.
    An asset is linked to a user or to a department. The user field is not mandatory, the department field yes.
    When creating or updating an item, we should be able to choose a user (person column) and the department should be automatically populated. Or we should also be able to let the user field blank and only choose a department.
    1. How can I manage this ? The user profile service is already configured, linked to the Active Directory. So user and department information is already in the User Profile.
    2. Second constraint : when a user is moving to an other department, the department field should be automatically updated for all items linked to this user. Any idea ?
    Thanks a lot and best regards,
    Steve Roh

    I think you must write some code for this functionality.
    It could be a custom web part or a custom field.

  • There is no item number field available in non catalog request screen

    Hi,
    I need help in understanding how the Contract purchase agreement works with i-procurement.
    1. created contract purchase agreement
    2. Setup the item
    3. Setup the price list for the item
    4. Setup the ASL for the item and referenced the CPA number in source document region.
    5. Created Sourcing rule for the item.
    I have no issues in defaulting sourcing information (supplier name, site name, source document number) when creating a requisition in core apps forms but how to setup the same feature in i-procurement? I selected non catalog request type but I don't see item number field available.
    Please advise.
    Thanks,
    Ram

    Hi,
    First we need to know which version you are in - 11i or R12.
    Also, non-catalog request is not used for the requisitions with Inventory Item.
    Just search for the Item number or description in the iProcurement and see whether the search result shows your item.
    Internal Item number field will show the Oracle Item number.
    Thanks,
    PS.

  • Telephone Number field when adding a new User - CCM 4.2.1

    Is their a way to automatically populate the telephone number field for a user? BAT does not allow this field to be added to the spreadsheet (phones-users). Thanks.

    BAT Version: 5.2.1
    The DN is for the actual line number of the IP phone, not the telephone number field which is stored with the User infromation. These can be independent; for example, I might make a user's actual DN 40001, but want the telephone number in the CallManager Corp Directory to be 5179840001. So, I can place the E.164 number in the Telephone Number field under the User page in CCM. Then, when a user looks up the number using the Directories button on the IP phone, the full E.164 number shows up for that particular user search instead of the 5-digit number which is helpful for offnet dialing and overlapping dial plans among remote sites.
    So, I am looking for a way to automactically populate the Telephone Number field for each user (not the line number of an actual IP phone).
    Thanks.

  • How to select number field starting with 99

    Hi Freinds-
    I have to pick values for a number field  but  i want only those values which starting with 99 
    how i can put code in select query for this ?
    Regards
    Meeta & Ruby

    Hi,
    Use the query as:-
    select
       <field1>
       <field2>
    from <database_table>
    into table <internal_table>
    where
       <field_name> like '99%'.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Urgent: number field

    Hi ...
    I have a form in forms6i with a no database block that have a serious of number field.
    When I populate this field with a procedure that use a cursor I see all the number inserted but no the zero value ....
    Then I give the format mask 9990 at the number field ... but the zero value is not visualized ...
    It's very import for me to find a solution very quick...
    Thank you
    Maria

    Hi
    Please note that NULL is not equal to 0. If your procedure returns null then replace it with 0 by nvl(value, 0) .
    HTH
    Arvind Balaraman

  • Dynamic creation of page items

    How can I create page items dynamic, if I have their number and their titles in a page item?

    More often than not you'll run into difficulties when trying to do something like this with APEX. However, you have two options:
    1 - The htmldb_item API, embedding items into a report based on the values of your previous page items.
    2 - Some combination of hidden fields and conditionals that makes use of your page item values for their label text.
    The former is well documented on the forum.
    Rgds
    Ben

  • Handling of pictures changed? Item values not properly updated in Beta 3?

    I had created an application which allows to upload an image for a row, basically based on what's done in the demo app for the products table.
    Today, I exported the app and then uninstalled Beta 2 and installed Beta 3. Installation finished without any problems - so far so good, but after I recreated my tables etc. and then imported the application, the image handling just didn't work any more...
    I took a look at the demo app in Beta 3 and saw that unlike before, it looks like the blob content is no longer being inserted into the DEMO_IMAGES table, but instead remains in wwv_flow_files (now called htmldb_application_files?). This feels wrong somehow, IMO the former approach moving the file content into the custom table was much safer and cleaner.
    Also, I noticed when I open an edit page from a report link and look at the session state then, the page item values don't get updated properly (in fact nothing gets updated except for the PK value I clicked on the report page) - this feels totally wrong as well (and I suspect some kind of coincidence here why the picture upload or display doesn't work any more like before)...strange enough, the items on the page show the expected values, but in session state display they are all empty (R).
    Is it intended to leave it this way? Why did it have to be changed at all?
    Somehow frustrated,
    Holger

    Holger,
    You are witnessing a couple things here.
    One - for Production XE, the configuration of the Database Access Descriptor for the embedded PL/SQL Gateway makes use of the request-validation-function. This is a function which validates the procedures being invoked from the URL. Out of the box, only those suitable for running XE are enabled. Otherwise, any publicly executable procedure in the database could be invoked directly from the URL, and for security reasons, this needed to be locked down. Search for "Restricting Access to Oracle Database XE" in the online help and you'll see instructions how to open up this validation function for your custom procedures which are invoked directly from the URL.
    Two - you are correct, the Demonstration Application was modified to use the global upload table instead of the custom upload table in your schema. Given the security decision (mentioned above), it was a choice between not locking down the procedures which could be invoked from the URL, or providing a demonstration application which would work for all customers out of the box. Obviously, we chose the latter. From a security standpoint, I highly recommend you to use your own table as you were before.
    As far as your comments about session state and the report link, nothing has changed in this regard. This is consistent and expected behavior. I confirmed this is consistent with HTML DB 2.0 and XE Beta. Scott discussed this on the OTN Application Express forum in a number of places, including here: Re: Automated Row Fetch, when does the value hit the session state?
    Thank you for your feedback. I do appreciate it.
    Joel

  • How to prevent a number field from getting summed?

    I want to display the # of clients per a certain ID number. (In order to show the duplicate records by setting a filter in the # of clients field). However, this works if the ID number is a text field... but it doesn't work if the ID number is a metric of client... or number. It gets summed up, I get the total, and the % of clients turns to be 1.
    Any ideas?
    Thanks

    Example:
    I have 3 clients:
    Column A
    55
    55
    44
    21
    I want the following output:
    55 | 2
    I get the desired result by adding a second column (# of clients) and creating a filter to get results only if the value is > 2.
    The problem is when "Column A" is a number field. If it is a number field, I get total sum of the records (55+55+44+21) and a value of "1" if I add the # of clients column.
    Is it clearer now? ideas?

  • Dynamically Update Form Fields

    I have a form with a dropdown where I can select an employee id. After it's selected I want to go to the database, get the corresponding information, and update the form fields. What is the best way to accomplish this?
    Thanks,
    Mark

    What kind of form you have a tabular form or a normal form?
    what version of apex you are using?
    if its a tabular form then you have to use ajax to fetch the values from database.
    if its a normal form then in apex 4.0 and above you can use dynamic actions for fetching the values.
    in older version you have to write a fetch process (before/after header) where you can fetch
    the associated values and assign them to respective items
    Thanks
    Tauceef

Maybe you are looking for

  • Reports 3.0 Size

    Currently the size of the report that is being generated in PDF format is about 90MB. Would appreciate if anybody could comment on reducing the size of the report. The body of report has no graphics, images, etc. It's just numbers and varchar2. The r

  • 24" iMac buzzing in Sleep

    I've been using Macs for roughly 10 years now but just recently bought my own. I purchased a 24" iMac and had no problems. I always put the computer to "sleep" when I know I won't be using it for a while. Now every, 5 minutes (give or take) I hear a

  • Downloaded a book from iTunes. Now how do I read it?

    What software is there to read eBooks on a mac? Kindle doesn't work nor does eReader pro. Any suggestions? Thanks,

  • ODI:importing an xml into anothr project

    Hi, please tell me as to how i can import an exported XML file in another project? Thanks, Jayant

  • Error Compiling Movie: Unknown Error +4k +Clip scale

    Just found an interesting issue, and solved it... thought I would share it with you guys as well. I received the Error Compiling Movie: Unknown Error when rendering a 1080 timeline with 4k footage all from RED. The whole timeline was "Scale to Frame