Run formula from a button

Hi everyone,
I have a form with 2 blocks. The first one is the master block and the second is the detail block. I use the first block to type the values that I want to search on my detail block. So when I display all the values on my detail block, the user has to make changes on it, like putting numeric values. After they finish typing they press a button where I have the formula which is the one to calculate a percent, but when we press the button only the row where I have the cursor is the one that gets calculate and not the rest.
Can anyone please help to create a code to calculate all the rows at the same time?
This is what I have on the trigger right now:
Begin
     If :BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 Between 0 and 100
          and :BLOCK1.ITEM3 Between 0 and 100 then
          :BLOCK1.ITEM4 := (:BLOCK1.ITEM1 * 0.40) + (:BLOCK1.ITEM2 * 0.40) + (:BLOCK1.ITEM3 * 0.20);
     Elsif
          :BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 Between 0 and 100 and :BLOCK1.ITEM3 is null then
          :BLOCK1.ITEM4 := (:BLOCK1.ITEM1 + :BLOCK1.ITEM2)/2;
     Elsif
               :BLOCK1.ITEM1 Between 0 and 100 and :BLOCK1.ITEM2 is null and :BLOCK1.ITEM3 Between 0 and 100 then
               :BLOCK1.ITEM4 := (:BLOCK1.ITEM1 + :BLOCK1.ITEM3);
     End if;
End;
[/CODE]
Thanks in advance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

After they finish typing they press a button where I have the formula which is the one to calculate a percent, but when we press the button only the row where I have the cursor is the one that gets calculate and not the rest.Can anyone please help to create a code to calculate all the rows at the same time?>
You don't mention your Forms version! If you are on Forms 5.0 or higher, you could use a Calculated Item to perform your calculate your percentage on each row. This would make your calculation real-time instead of on-demand and the calculation would be performed on each row! Open the property pallet of the calculated item and scroll to the Calculation node.
If you prefer to perform the calculation on-demand as you have coded it, then you need to loop through each record in the data block (as InoL suggests) otherwise it will only perform the calculation on the selected record.
I have to put that code on my button or on my block level? Put the code in your When-Button-Pressed trigger!
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.
Edited by: CraigB on Oct 3, 2011 8:27 AM

Similar Messages

  • Running report from a button in forms 6 with parameter

    im new to reports 6 please give me the code for running report from a button in forms 6 with parameter
    regards

    Hi ,
    Use this SRW.RUN_REPORT..
    Go thru the help in Reports by typying
    Running a report from Form Builder or Graphics Builder
    go thru the instuctions and examples.
    --Basava.S                                                                                                                                                                                                                                                                                                                                                                           

  • FRM-92101 error while running report from a button or menu

    Hi All,
    I am getting the error FRM-92101 while running report without parameter from a button or menu. I am using Developer Suit 10g. I get the error as it shows there has some configuration problem in my form. Will you please help me anyone how can i solve the problem. My previous forms running very well both with parameter and without parameter.
    Arif

    Hello Sir,
    Thanks for your cooperation. I have solved my problem by myself. The fact was that, when i tried with the following code which made my report---
    SELECT br.bid, br.bname, br.branchtxnstatus, dif.difference
    FROM branch br,
    (SELECT gladbrid branchid,
    SUM
    (CASE
    WHEN ga.gl_acc_categry IN ('L', 'I')
    THEN gd.gladbalance
    ELSE -1 * gd.gladbalance
    END
    ) AS difference
    FROM glaccount ga, glaccountdetail gd
    WHERE ga.glid = gd.gladglid
    GROUP BY gladbrid) dif
    WHERE dif.branchid = br.bid AND br.branchtxnstatus = :Br_Status
    and dif.difference!=0
    ORDER BY br.bid;
    and the code against the button or menu item is---
    DECLARE
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status VARCHAR2(20);
    BEGIN
    repid := FIND_REPORT_OBJECT('ASSET');
    v_rep := RUN_REPORT_OBJECT(repid);
    rep_status := REPORT_OBJECT_STATUS(v_rep);
    WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
    LOOP
    rep_status := report_object_status(v_rep);
    END LOOP;
    IF rep_status = 'FINISHED' THEN
    /*Display report in the browser*/
    WEB.SHOW_DOCUMENT('http://192.168.0.21:8889/reports/rwservlet/getjobid'||
    substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
    ELSE
    message('Error when running report');
    END IF;
    Clear_message;
    END;
    Clear_message;
    which has shown the error FRM-92101 and didn't run the report.
    In that case I have changed the query to run the report. first of all i create a view following the query and build the report using a simple select query. that's etc. my report running fine now.
    It is mentioned that there had no error on my codes.
    Arif

  • ScriptUI run script from dialog button

    Here is what I have right now.  It is a little clunky in the way it works, and I would just like to make it a bit slicker.
    I have a script on startup that creates a Menu item with a dropdown submenu item. when you click on the submenu item, it starts a script. 
    The first thing the script does is pop up a message box that tells them that two dialog boxes are going to popup. The first one asking them to choose the location of an xml file and the second dialog box that ask them to choose the location of their image folder.  After they finish choosing their folder in the second dialog, the script takes those two values, makes them variables, and continues to run the rest of the script. 
    Here is what I would like it to do..
    1. open a dialog window with two input fields, two "browse" buttons, and OK and CANCEL buttons
    2. when you click the first browse button next to the first input field, it will open a file dialog window.  You select your file and the file string will populate the input field
    3. when you click the second button next to the second input field, it opens a folder dialog window.  You select the folder and the string populates the second input field.
    4. when you click OK, it feeds the values in the input fields to a script.
    I already have scripts to that open the file and folder dialogs, but what I can't figure out  how to do is to start and run a script from a button press, in this case, when the OK button is pressed.  It is probably an onClick, but I haven't been able to find any examples of what the syntax would be. 
    The closest I have found is in the Beginning ScriptUI document that was on Jongware's site, in the section on Communication between windows.  But that opens each of the windows with a different script and not using a button press to call a script.
    As always, any point in the right direction is very much appreciated. thanks.

    Thanks Gotterman, but the issue I was having was that the dialogs I was opening were not being created by me.  They were more like OS generated windows.  So I am not able to give the window a name, or the input field a name in order to reference it.
    Peters response was actually correct, although I did have to open the folder dialog a bit differently to get it to work.  I had to use a style that I got from Jongware in a previous thread, but the concept that Peter showed in the last post pointed me in the right direction. 
    I just have one more piece to figure out, how I am going to pass the variables to another script, but I think that is something i will have to work out on my own.
    For anyone who is curious, here is the code I came up, modifying and combining some of Peters examples from the book plus the help he gave me in this thread.  The alert after closing the dialog is just for testing to show that the values are being held by the variables so I can use them else where.
    function mySnippet(){    
    //<fragment>   
    #target indesign;
    #targetengine "session";
    var w2 = new Window("palette", "Window 2", undefined, {resizeable: true});
    var e2 = w2.add ("edittext"); e2.characters = 30;
    var e3 = w2.add ("edittext"); e3.characters = 30;
    var f2 = w2.add ("button", undefined,"Browse XML");              
    var f3 = w2.add ("button", undefined,"Browse Folder");              
    var f4 = w2.add ("button",undefined,"SAVE AND RUN");              
    var tf              
    var tfo                
    f2.onClick = function()                {               
    tf = File.openDialog("Select your XML File","*.xml");                    
    if (tf != null)                    
    e2.text = tf;                    
    f3.onClick = function()                {              
    var tfol = new Folder("~/My Documents")               
    tfo = tfol.selectDlg("Get Folder");                    
    if (tfo != null)                    
    e3.text = tfo;                    
    f4.onClick = function()               
    w2.close();                   
    alert ("xml value: " + tf  + "\nfolder value: " + tfo);                
    w2.show();    
    //</fragment>

  • How to run javascript from Item Button?

    How to make an Item Button to run a javascript?

    Specify custom URL target as : javascript:yourFunction().
    Alternatively, specify item attributes:
    onclick="yourFunction()"
    Ta,
    Trent
    Edited by: trent on Nov 25, 2010 4:39 PM
    typo

  • How to run a dialog's method from a button's event handler?

    I've created my first dialog from the samples, but I am having trouble figuring out how to run a method in my dialog from an button's event handler. Can anyone please point me in the right direction?
    function CreateDialog() 
        this.windowRef = null;
    CreateDialog.prototype.run = function()
        //...declare a bunch of vars
        // Create a window of type palette.
        var win = new Window("dialog", "Element Spray Generator",[iTop,iLeft,iTop + iWidth,iLeft + iHeight] );  // bounds = [left, top, right, bottom] 
        this.windowRef = win;
        // Add a frame for the contents.   
        win.btnPanel = win.add("panel", [iPadding,iPadding,iWidth-iPadding,iHeight-iPadding], "");
        .... add a bunch of other stuff ...
        win.btnAdd = win.btnPanel.add("button", [win.btnRemove.bounds.left - iPadding - iButtonWidth,win.lstImages.bounds.bottom + iSmPadding,win.btnRemove.bounds.left - iPadding,win.lstImages.bounds.bottom + iSmPadding +iTextHeight], "Add");
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- problem is on this line here!!
        this.EnableControls();  //<--- this works
        // Display the window
        win.show();
        return true;      
    CreateDialog.prototype.EnableControls = function (){
        var result = true;
        result = result && (this.windowRef.ddlPaths.selection != "");
        result = result && (this.windowRef.lstImages.items.length > 0);
        this.windowRef.btnOK.enabled = result;

    This may not be the reason, but when using the way I create dialogs 'this' inside of an onClick points to the control.
        win.btnAdd.onClick = function() {
           //todo implement this
           var f = File.openDialog("Open File") ;
           win.lstImages.add("item", f.displayName );
           this.EnableControls();    //<--- I would expect it to call another function of btnAdd
                                            // this.parent.EnableControls() might be what you want if the control is not in some other container

  • Firefox installed the latest version. Now my google browser, history etc. doesn't work anymore. It doesn't respond. I can't run searches from the browser. youtube button is missing. I've tried opening firefox in safe mode but that doesn't work.

    # Question
    firefox installed automatically the latest version. Now my google browser, history etc. doesn't work anymore. It doesn't respond. I can't run searches from the browser. youtube button is missing. I've tried opening firefox in safe mode but that doesn't work

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    What happens if you open Firefox in Save mode?
    *https://support.mozilla.com/kb/Safe+Mode
    *Help > Restart with Add-ons Disabled

  • #Include or run script from HTML panel button?

    I'v been trying to make a panel with the HTML widget and I keep running into issues. The buttons I made wont run the scripts. Is there a way to include js for PS inside the html to run when the button is pressed? <script></script> doesn't seem to work for things inside of PS. Or is there a way to run a script in PS from a button?
    I guess I have multiple questions really. Do you always have to use _AdobeInvokeScript inside the button? I have seen some examples without it and I'm not sure what works and what doesn't.

    Thank you Paul!
    %20 is just how space characters are encoded and doesn't matter
    Ye, I know this,.. it`s was my just suggestion...
    So. The solution in this string:
    var scriptFile = File(File($.fileName).parent.parent.absoluteURI + "/Change Render Locations.jsx")
    Everything else is identical, in my script and in your. Of course except alerts. I remove them, and now i have just my button which works fine....
    And may be you can suggest, why does not work "my" method of running the script?
    Thanks again!

  • CJ20N, add button to run report from network screen

    Hi,
    I've got requirement to run raport from CJ20N on user's action from network screen.
    I don't know is it possible to add a button in this transaction on network level.
    Do you know how to run a new raport?
    Thanks for any ideas.
    Regards,
    Kaz

    I think you may need to implement enhancement 'CNEX0007'
    CMOD==> Enhancement==> Componet==> Get the Screen area.
    Go to SE41 ==> Give the Screen program and number==> add your WBS tab there. The values will be available to screen
    link given below which shows step by step proc with snapshots.
    http://www.sapdevelopment.co.uk/enhance/fexits.htm
    <b>Reward points</b>
    Regards

  • As I run or called the editor sqlplus from a button?

    Como llamar la ejecucion del editor de sqlplus desde un boton? Que el boton ejecute esto: c:\oracle\app\products\10.2.0\server\BIN\sqlplus.exe
    Message was edited by:
    user647378
    Message was edited by:
    user647378
    Message was edited by:
    user647378

    I used google translate to clarify the question (I hope at least) for the dummies like me (:, who don't speak any Spanish, and this is the result.
    Subject: As editor sqlplus run from a button?
    Message:
    Calling the execution of the editor sqlplus from a button? The button run this: c: \ oracle \ app \ products \ 10.2.0 \ server \ BIN \ sqlplus.exe

  • Running reports from forms on the web

    On forms and reports 6i we used the following code to run reports from forms.
    We need to do the same on 9i forms and reports, we are running into problems.
    Any help will be appreciated.
    PROCEDURE web (inFileName VARCHAR2,
    inRecordGroup RECORDGROUP) IS
    outVirtualPath VARCHAR2(200) := '/forms90/f90servlet?p_url=/reports/rwservlet?'; outServer VARCHAR2(200) := 'server=rep_ora-app-4';
    outReport VARCHAR2(200) := 'report='||inFileName;
    outUserid VARCHAR2(200) :=
    'userid='||GET_APPLICATION_PROPERTY(USERNAME)||'/'||GET_APPLICATION_PROPERTY(PAS
    SWORD)||'@'||GET_APPLICATION_PROPERTY(CONNECT_STRING);
    outDesType VARCHAR2(200) := 'DESTYPE=CACHE';
    outDesFormat VARCHAR2(200) := 'DESFORMAT=PDF'; outUser VARCHAR2(2000);
    outCount INTEGER;
    error we are getting.
    FRM-42017:Module name must be specified.

    S Hatch (guest) wrote:
    : I'm thinking that you're going to have to install the Reports
    : cartridge, create an entry in the keymap with any parameters
    and
    : call your report via the url.
    : Dessislava Gantcheva (guest) wrote:
    : : How do I call a report from a form on the web?
    : : I have installed Windows NT Server 4.0 with SP 5, OAS4.0.7
    EE
    : : with patch 1, Developer 6.0 with patch 1. Developer server
    and
    : : forms server work fine in a non-cartridge implementation,
    but
    : I
    : : cannot run a report within a form. I just have no any info
    how
    : : to do this.
    I have entries in my keymap file and I can call my reports via
    the url, but I cannot run a report WITHIN a form. I mean to call
    a report by clicking on a button of a form on the web. The
    RUN_PRODUCT built-in does not work (at leas it seems like this)
    If any one has expiriense with it, please, give me a hint.
    Thanks
    null

  • Disconnect from WiFi Button in Yosemite (Faster File Transfers via Airdrop)

    Hi all! Just thought I'd share a great new pro-tip I found that's pretty handy.
    Sometimes file transfers through a complex or busy network with a  (think hotel lobby or coffee shop), Airdrop file transfers can run extremely slow vs. it going from computer to computer via no network (Ad Hoc). I was determined to find a work around for disconnecting from a WiFi network without turning off Wifi.
    Anyways, Yosemite introduced a much asked for feature - The disconnect from WiFi button! Just hold down option while you select the WiFi indicator on the menu bar and click disconnect! Your WiFi will continue to be on and it simply won't connect to that network again. If you now search for other computers in AirDrop, it will find them and be a much faster computer to computer connection.

    Testing in a new User will quickly tell you if the problem is system wide or if it's your User's folder that contains the problem.
    CREATE A NEW USER
    Go to System Preferences --> Create a New User in Users & Groups Switch to the New User by logging out/in or use Fast User Switching.
    Enter your Apple ID and password.
    Test Markup in Mail using the iCloud account.
    Continue testing to see what works in the new User.
    Do you still see the issue?
        If yes, then the problem is with your base files.
        If no, then the problem is in your User's folder.
    Finder - my iMac name is - iMacs iMac. All of a sudden it become iMacs iMac (2) and latter iMacs iMac (6). What are these numbers ?
    In System Preferences > Sharing you can see name. When Finder adds a number it indicates it's seeing another drive with the same name. You can select to rename but this could also be an indication of issues at the base level.
    Do you have an external drive that could be used to clone your drive in case you need to do a clean install?

  • T61 Display Problem and Annoying Noise from ESC button area

    I have two problems with my T61, model 6460-66U. One's with display and another is annoying noise coming from ESC button area.
    Ordered in Feb, 2008 for college use, as soon as I start to use it there's some problem with the display quality. When using Aero there would be black square spots appearing on screen and would disappear when hovering mouse over these areas. Processing speed is somewhat slow when using Aero. While switching to Basic Vista style, those black square spots will only appear in the Windows Photo Gallery's left corner, like the image shows: http://farm4.static.flickr.com/3149/2746362257_6dc6a4d6a2_o.jpg  When playing videos, like avi, rmvb, wmv files, there's a common problem that the screen in the media player keeps flashing with the green color. I thought it was the RAM, because it's 1G so it got upgraded to 3G over summer break. Hoping the problem would be solved, but not . Recover the system back to factory status helps a little, but after upgrading the newest driver (7.15.11.7597) of Nvidia 140m there would be sudden black out on screen, and notice of display driver stopped working. When degrade to 7.15.11.129 version it runs fairly well but problem with Photo Gallery and videos as mentioned above still exist. I found a Korean media player which could fix the video playing problem, but with Windows Media player, Realplayer and other major video player the problem still exists. Screenshot of the problem is here http://farm4.static.flickr.com/3087/2746362307_aff12c556c_o.jpg  I upgraded BIOS, but laptop would become slow and video images would blur/double shadows. So I swtiched it back.
    And recent few days, there's annoying noise coming from in the upper left corner, where ESC button is. I don't know whether it's from the fan or the AC adapter, it's like Zssssss, and if I press my finger on it, the noise would be a little louder. There's a similar problem that I noticed in the first few weeks with the experience of this laptop, whenever I maximize the volume (both volume control of computer and the music player), some annoying noise, which is similar to this Zsss sound but louder will buzzing along with music. Didn't care much about that since if I don't maximize the volume it would just be fine. But this time the whining noise won't disappear. What probably cause this?  Anyway to fix it, like replacing certain parts??
    Suggessions and help would be very much appreciated. Thanks!!
    Original description: T7300(2GHz), 1GB RAM, 160GB 5400rpm HD, 15.4in 1680x1050 LCD, 128MB nVIDIA Quadro NVS 140M, CDRW/DVDRW, Intel 802.11agn, Bluetooth, Modem, 1Gb Ethernet, UltraNav, Secure chip, Fingerprint reader, Intel Turbo Memory, 6c Li-Ion, WinVista Business
    Message Edited by dream on 08-09-2008 09:35 AM
    Message Edited by dream on 08-09-2008 09:38 AM

    Dirt can get under the button in an instant.
    I use a strong suction vacuum cleaner and tip the computer from side to side and upside down while clicking the button to suck out the dirt.

  • ItunesU videos not playing in Itunes but play ok if you download to laptop's drive and run them from windows directory

    I'm having a problem playing some ItunesU videos, some play okay, some just show black screen and don't play, others show a still image but then doesn't play when trying to view them from itunes store. The audio files play with no issues.
    I am using windows 7.
    However, if I download the videos that don't play to the laptop's drive and run them from the windows directory they play okay. I don't want to have to download videos to see if they are something I'd like to watch.
    Just for reference, an example of a video that plays okay is by UC Berkeley Math 16A 001, Fall 2011. Another is Introduction to Robotics by MIT.
    An example that just shows blank screen is Stanford's Iphone & Ipad development, Fall 2011, both HD and SD versions.
    While an example of a video that just shows the initial image but doesn't play is Harvard's Statistics 110. If you adjust the time of the video, the video moves to that part of the video but only shows the image at that time, ex. at 13:02, but doesn't play.
    I've tried reinstalling quicktime first, then itunes. I've also tried putting directdraw in safe mode, but the problem videos still won't play.
    Could it be some setting, since it plays when the file is downloaded but won't play straight from itunes store online (ie. pressing the play button beside the video in the itunes list).
    Help pls.

    You might have more luck asking on a general Windows troubleshooting site, but my guess would be an invalid or old audio or CD driver (or firmware in the drive). You might try checking those to make sure you have the correct and most current drivers.

  • Apple Imac G5 Wont Run Setup From DVD

    hi guys ive got an apple imac g5
    and for some reason it wont run setup from any of the mac dvd's or cd's i have
    the superdrive spins up and it does nothing even when i press and hold the letter c' key on the keyboard
    the spec is as follows
    Imac G5 - 17/1.6/2gb/combo/500gb hd
    any help would be greatfull
    and another thing can i use my windows based pc to load the os via target mode useing firwire
    thanks
    jason

    Another help source (if you haven't already done so).
    Go to your OS Help Menu. In the search field type dvd or cd
    Click on all the troubleshooting topics & Support Articles that pertain to your issue.
    You can also do the same in Disk Utility. Open same up.
    At the bottom left of the window, click on the purple button w/the "?" in the middle.
    This will bring up the Help Menu.
    ===============
    Try a different brand. Top forum favorites
    CDs
    FUJI
    TDK
    Verbatim
    DVDs
    Maxell
    Make sure the DVDs are not dirty, smudged and/or scratched.
    http://docs.info.apple.com/article.html?artnum=50448 How to Handle and Clean CD and DVD Discs
    Your drive may need cleaning. Cleaning kits can be purchased from any store that sells CD/DVDs.
    "can i use my windows based pc to load the os via target mode useing firwire"
    Hopefully, someone more knowledgeable than me can answer that one for you.

Maybe you are looking for

  • Unable to start gnome-session or gdm

    Sorry for the vague title. I don't really have any specifics to go on for this problem. When I try to start a gnome-session through startx, I get a screen that says, "Oh no! Something has gone wrong", with no error outputs in xsession-errors. First o

  • Change Logs in Rebate Recipient Data

    Good Morning! Do you have a TCode or a report detailing the change logs in the Rebate Recipient data? Thanks in advance!

  • Billing Configuration

    Hi Gurus, We have a new process in place due to which we do require to have billing doc. Earlier the Z item category was maintained as not relevant for billing. Can you please give me the detailed list configuration to be made in order to get billing

  • The requested instance is either invalid or not running

    I try to set up a datasource to SQL server 2008 Express. And I get always that message : The requested instance is either invalid or not running. I spent a full day looking at all forums threads, I have learn a lot, Looking through all Google return

  • Flex files in Non-Flex Project

    I use Eclipse for developing in Java. I have been trying out the Flex 3 (public beta) plugin for Eclipse. I can create a new Flex project and all of the Flex files compile and work correctly. But how do I add Flex files to an existing project (non Fl