Update using checkboxes

I have a new web page where the user wants to be able to check off lines on a very extensive list to reconcile them with a customer's report. I'm using a report like this:
select DATE_INDEX, EQUIP_ID
       , DESCRIP, WT, HAUL_BY, FLAG
    from (
    select c.DATE_INDEX as DATE_SORT
         , j.JOB_START_TIME as TIME_SORT
         , to_char(c.DATE_INDEX,'Mon DD') as DATE_INDEX
         , to_char(c.EQUIP_ID) as EQUIP_ID
         , to_char(c.EMP_ID) as EMP_ID
         , to_char(j.JOB_START_TIME,'HH:MI AM') as JOB_START_TIME
         , to_char(j.JOB_END_TIME,'HH:MI AM') as JOB_END_TIME
         , 'Load at '||s.SHORT_NM||', Unload at '||f.FACTORY_NM as DESCRIP
         , to_char(NVL(j.MAN_SPOT_WT,0),'999G990D00') as WT
         , apex_item.display_and_save(48,'TS') as HAUL_BY
         , apex_item.display_and_save(49,j.LOAD_JOB_ID) as JOB_ID
         , apex_item.checkbox(50,j.RECONCILE_FLAG,null,null) as FLAG
      from TC c, TC_LOAD_JOBS j, LOAD_RATES r, FACTORIES f, STATIONS s
     where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
       and j.FACTORY_ID = f.FACTORY_ID
       and FN_STN_KEY(j.FACTORY_ID, j.STATION_ID) = s.KEY_ID
       and r.ROPA_FLAG = 1
       and DECODE(:P961_TYPE,99,j.RECONCILE_FLAG,:P961_TYPE) = j.RECONCILE_FLAG
       and c.VEH_LOC in (select ORG_ID from ORG_ENTITIES
           where MNG_ORG_ID = :P961_ORG_ID)
       and c.DATE_INDEX BETWEEN to_date(:P961_FROM_DT,'MM/DD/YYYY')
           and to_date(:P961_TO_DT,'MM/DD/YYYY')
    union all
    select c.DATE_INDEX as DATE_SORT
         , NULL as TIME_SORT
         , to_char(c.DATE_INDEX,'Mon DD') as DATE_INDEX
         , c.UNIT_ID as EQUIP_ID
         , '-IND-' as EMP_ID
         , NULL as JOB_START_TIME
         , NULL as JOB_END_TIME
         , 'Load at '||s.SHORT_NM||', Unload at '||f.FACTORY_NM as DESCRIP
         , to_char(NVL(j.ACT_SPOT_WEIGHT,NVL(j.AVG_SPOT_WEIGHT,0)),'999G990D00') as WT
         , apex_item.display_and_save(48,'OTHR') as HAUL_BY
         , apex_item.display_and_save(49, j.JOB_ID) as JOB_ID
         , apex_item.checkbox(50,j.RECONCILE_FLAG,null,null) as FLAG
      from TC_3RDPARTY c, TC_3RDPARTY_JOBS j, LOAD_RATES r, FACTORIES f, STATIONS s
     where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID
       and j.FACTORY_ID = f.FACTORY_ID
       and FN_STN_KEY(j.FACTORY_ID, j.STATION) = s.KEY_ID
       and r.ROPA_FLAG = 1
       and DECODE(:P961_TYPE,99,j.RECONCILE_FLAG,:P961_TYPE) = j.RECONCILE_FLAG
       and c.VEH_LOC in (select ORG_ID from ORG_ENTITIES
           where MNG_ORG_ID = :P961_ORG_ID)
       and c.DATE_INDEX BETWEEN to_date(:P961_FROM_DT,'MM/DD/YYYY')
           and to_date(:P961_TO_DT,'MM/DD/YYYY')
  ) where rownum <= 500
order by DATE_SORT, TIME_SORTbecause obviously the only field I want them changing is the RECONCILE_FLAG field.
I know that checkboxes are dicey in that they either exist (when checked) or don't exist, so using them in loops is somewhat problematic. I'm trying to use something like this:
declare
begin
    for i in 1..apex_application.g_f49.count loop
      IF apex_application.g_f48(i) = 'TS' THEN
        update TC_LOAD_JOBS
           set RECONCILE_FLAG = NVL(apex_application.g_f50(i),0)
         where LOAD_JOB_ID = apex_application.g_f49(i);
      ELSIF apex_application.g_f48(i) = 'OTHR' THEN
        update TC_3RDPARTY_JOBS
           set RECONCILE_FLAG = NVL(apex_application.g_f50(i),0)
         where JOB_ID = apex_application.g_f49(i);
      END IF;
    end loop;
end;to allow the update.
Can someone spot check and tell me if this is going to work or if I'm going to have to incorporate another loop inside the main loop to handle the checkbox?

I don't think that's going to fly. The size of the checkbox array reflects the volume of items checked on the page, thus if your report contains 20 rows but only 5 of them are checked (at random intervals, say), your loop is going to fall over at the value i=6, because apex_application.g_f50(6) won't exist. The method I've used before is to assign the value of the checkbox to a key value (depending on your data model but in this case, probably j.TC_ID) and my query will use that method to update.
Alternatively, if you were able to generate and utilize the row number for your dataset (i.e. store the row number as the checkbox value, instead of), you iterate through a loop of the checkbox array, in a sort of "tail wagging the dog" manner. In other words, the checkbox value would provide index value for the array of the ID that uniquely identifies your tuple. like so:
for i in 1..apex_application.g_f50.count loop
update TC_LOAD_JOBS
           set RECONCILE_FLAG =  <whatever your checked value is>     
      where LOAD_JOB_ID = apex_application.g_f49(apex_application.g_f50(i));
end loop;

Similar Messages

  • Query update using checkbox

    I have an admin page for a secure site where I am trying to
    add a function using a checkbox to create a true-false condition on
    each record in a database. What I have is a webpage with several
    records (pulled from the database using the cfquery loop, and
    assigned an ID that is stored in the database). Each record on the
    page has a checkbox; checked=true. What I want to do is make it
    possible to edit the checkboxes on the page, then have the user
    refresh the page using a submit button on the form, which will then
    update the database. However, I'm having a problem passing the
    value of the checkbox correctly to a cf page to run the update
    query and refresh the page.
    What values am I passing forward from a form using a
    checkbox, and what datatype should I be using to store that value
    in a SQL Server 2000 database? (Right now I'm testing with Access.)
    How do I convert the value from the checkbox to the true/false
    condition for the database to fit that datatype?
    My understanding is, the criterion for a checked box is
    checked="checked", and nothing if not checked. But how do I check
    to see if that value has changed? I'd rather do this without
    Javascript.
    Thanks!

    Tried it. Didn't work.
    Here's the code:
    <td><input type="checkbox" <cfif
    (#GetHeadlines.Show# EQ true)>checked="checked"</cfif>
    value="chk#getheadlines.id#" /></td>
    Here is also the code it's going to:
    <cfif isdefined ("form.value")>
    Value: #form.value#<br />
    </cfif>
    For good measure, I thought I'd include the form declaration:
    <form name="update" action="update_admin.cfm"
    method="post">
    This is just for testing purposes for now. However, I'm
    getting nothing on the back end page. So the value isn't being
    passed. I must be doing something wrong with the form, but
    what?

  • MultiRow Update using CheckBox

    I have a multi-row table and the user is supposed to check/un-check a check box to indicate which row needs to be updated. After the user clicks on the save button, I want to process each row and set a field in the row to a certain value based on the checkbox value (true or false)
    Using Jdeveloper 10.1.3.2.

    Hi,
    have a look at example 117 at http://radio.weblogs.com/0118231/stories/2004/09/23/notYetDocumentedAdfSampleApplications.html
    If you want to use this information to update a field then this can be done without the detour of using a temporary unbound checkbox
    Frank

  • Update multiple records using checkbox

    Hi All,
    I have one requirement related to multiple record update using checkbox.
    HTML form has 6 columns and many rows.
    Now i want to update all 6 columns in the table for selected checkbox.
    Can any body give me some idea/code about this.
    Thanks in advance.
    Ravi

    I did not understand your idea.
    multiple columns can be updated as follows...
    update table set col1=value,col2=value,col3=value where conditions;
    We are using adodb driver in our environment. So I will explain concern to it. Store all the form new values in $var array and you can pass this $var to query execution.
    A vague idea
    $rs = $conn->Execute($update_sql,$var);     
    if ($rs===false) die('DB Error: '. $conn->ErrorMsg() );

  • "Enable Disk Use" checkbox is grayed out, can't untick.

    Hi,
    I just got my new iPod 30 GB video today! I've been reading these discussions, but haven't found an answer for this tiny problem of mine.
    "Do Not Disconnect" constantly shows on the iPod screen when it's connected on the computer. Many have suggested ticking off "Enable Disk Use", but here's the problem: it's grayed out, and I can't change it, no matter what. I've gone through iTunes prefs, by right-clicking on the iPod in iTunes and selecting "iPod Options". My system seems to show iPod as a movable disk, but iTunes recognises it and I can easily put music into it, so I guess that isn't a problem (or is it?).
    But how could I get my hands on the "Enable Disk Use" checkbox? It just isn't "tickable" now.
    Thanks!
      Windows XP  

    If you have your iPod set to manual update, the "Enable Disk Use" box will be greyed out and ticked by default, in that case use Safely remove Hardware icon or check this link: "Disconnecting iPod from your computer
    " http://docs.info.apple.com/article.html?artnum=61135
    For Info:
    The iPod offers three ways to transfer music from your computer. You can select one of the following update modes from the iPod Preferences menu in iTunes (Edit=>Preferences=>'iPod' tab):
    1) Automatically update all songs and playlists. This is the default mode, in which your entire music library, including playlists, is automatically synced to your iPod. If the music library on your computer exceeds the iPod storage capacity, you are prompted to select a different update method.
    2) Automatically update selected playlists only. With this option, iTunes automatically copies the playlists you have selected to the iPod when you connect it to the computer.
    3) Manually manage songs and playlists. You can also choose to transfer music to the iPod manually. This allows you to drag and drop individual songs and playlists from iTunes to the iPod.

  • How to undo update of checkbox after triggering when-new-record-instance

    Hi,
    I am using eBusiness Forms Personalization in 11.5.10 to alter the Receipts form in Purchasing. I want to prevent users checking the rcv_transaction checkbox if the destination is "Multiple" and, instead, click the "+" sign to explode the multiple record into it's many component records.
    I can do this by invoking the when-new-record-instance trigger to make the "multiple" record fields unalterable and issue a warning message when the user selects such records. However, my problem is that - if the user clicks the checkbox as the first field in a "multiple" record, then this updates the checkbox to "Yes" BEFORE the trigger fires, which then locks the record for update.
    What I need is a solution that either sets the checkbox to unalterable for "multiple" records BEFORE the user clicks into such records, OR a method of undoing the update of the checkbox after the record has been selected (I cannot do this by simply setting it to "No" by the trigger as this is still technically an update and locks the record).
    Cheers
    Graham

    Hi Navnit,
    Yes you are right, but it can work even we not plase quotation mark in it. But Yes I forget to place semi colon so now it is
    IF :System.Cursor_Record = 1 THEN
       :Block.Col1 := '02:00';
    ElsIF :System.Cursor_Record = 2 THEN
       :Block.Col1 := '07:00';
       ------and so on
    END IF;Danish

  • I am going to make a ADG with around 7 columns 6 of which I am going to use checkboxes as Item renderer

    I am going to make a ADG with around 7 columns 6 of which I am going to use checkboxes as Item renderers. Each of these 6 checkboxes renderers will be define in separate actionscript files as they will be updating different parts of the ADG data provider. Does this sound like the best option?

    Well the only difference is that each checkbox effects a different attribute of the  dataprovider of the ADG:
    for example this renderer effects the isSelected attribute. I may want to set a different one , hope this explains it better
    package
    import flash.display.DisplayObject;
    import flash.events.KeyboardEvent;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    import mx.controls.CheckBox;
    import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
    import mx.controls.listClasses.ListBase;
    *  The Renderer.
    public class CheckBoxRenderer extends CheckBox
        public function CheckBoxRenderer()
            focusEnabled = false;
         override public function set data(value:Object):void
            super.data = value;
            if(super.data.isSelected == null){
                data.isSelected = false;
            data.isSelected = this.selected;
            invalidateProperties();
        override protected function commitProperties():void
            super.commitProperties();
            if (owner is ListBase)
                selected = ListBase(owner).isItemSelected(data);
        override protected function keyDownHandler(event:KeyboardEvent):void
        override protected function keyUpHandler(event:KeyboardEvent):void
        override protected function clickHandler(event:MouseEvent):void
              super.clickHandler(event);
            if(!data.isSelected){
                data.isSelected = true;
            }else{
                data.isSelected = false;
        override protected function updateDisplayList(w:Number, h:Number):void
            super.updateDisplayList(w, h);
            if (listData is AdvancedDataGridListData)
                var n:int = numChildren;
                for (var i:int = 0; i < n; i++)
                    var c:DisplayObject = getChildAt(i);
                    if (!(c is TextField))
                        c.x = (w - c.width) / 2;
                        c.y = 0;

  • Using checkbox as ItemEditor fails

    I am trying to use a CheckBox as an itemEditor inside a
    DataGrid so i am doing this:
    <mx:DataGridColumn dataField="idDoctoEnvio" headerText=" "
    itemEditor="mx.controls.CheckBox" editorDataField="selected"
    editable = "true"/>
    I read in the developer's guide that this is the way to do
    it, so i tried it and to my surprise, it doesn't work, i menan
    there is no CheckBox control inside the datagrid, instead there is
    a normal text value (true or false).
    Any ideas on how to do this? I need the checkbox to be able
    to change that property from true to false and viceversa

    I reported this problem to Adobe
    last year. From your other post, I assume you already got
    the upgrade and so I further assume they didn't fix it. Nice to see
    they are listening.
    Long story short, you can't use CheckBox as an
    itemRenderer/itemEditor. It just doesn't work as promised. What I
    did was I developed my own CheckBox item renderer class (I put the
    CheckBox component inside an HBox so that I could also center it in
    the cell). With the appropriate logic, it works fine. I made this
    component a long time ago and the source is not on this computer,
    but I think the problem was related to the CheckBox not updating
    its selected property in accordance with the background data. In my
    component, I set the CheckBox's selected value to update according
    to the "dataChange" event and on the CheckBox's "change" event, I
    called a method to update the data["columnName"] value so that it
    matches the CheckBox's selected value. I think this will do the
    trick. The code is probably still archived in this forum
    somewhere.

  • How to modify a lookup field-type to use checkbox instead of radiobutton?

    How to modify a lookup field-type to use checkbox instead of radiobutton?
    I would like to modify the behavior for the lookup field.
    Normally you get a screen where it is possible to search through a lookup. The items resulted from the search are listed as radiobutton items. Therefore you can select only one at the time to be added.
    Is it possible to have the items to be listed as checkbox instead? So that you can check multiple items and therefore be able to add multiple items at the time?
    For example:
    To add the user to 10 different groups on MS-AD.
    It is desired to have the ability to check multiple groups to be added instead only one at the time.
    My client would like to use this feature in many other situations.

    Displaying will not be a big deal but with that you have to customize the action class and its working as well.

  • How to use Checkbox  and radio buttons in BI Reporting

    Hi BW Experts,
       My Client has given a report in ABAP format and the report has to be develop in BI.It contains Check boxes and the radio buttons. I don’t know how to use Checkboxes and radio buttons in Bex.For using this option, do we need to write a code in ABAP.Please help on this issue.
    Thanks,
    Ram

    Hi..
    Catalog item characteristic
    - Data element
    - Characteristic type
    Entry type
    List of catalog characteristics
    Designer
    Format (character)
    Standard characteristic
    Alternative: Master characteristic
    (used for automatic product
    assignment)
    Simple entry field
    Alternatives:
    Dropdown listbox or radio button
    list

  • If you are attempting to update using a Mac or PC with which you do not normally sync

    what happens when "If you are attempting to update using a Mac or PC with which you do not normally sync", & they say in step 2 or 3 in order not to loose your stuff "If you are updating your iOS device on a computer with which you do not normally sync , or if you disconnect your device before the sync process is complete, you may notice that some media content that was previously on your device is no longer there. You can restore this content by syncing with the Mac or PC with which you normally sync."
    now what if the pc that was originally used to sync my ipod , has corrupt or  bad systems files that are causing it from working correctly...? when i plug it in to the o.g. operating sysytems (win xp) it doesnt ever recognize or discover the ipod through itunes.  the pc will pop up the "cameras been plugged in, what would you like to do...?" but nothing thru itunes.  now if i reboot & run the windows 7 operating system w/itunes that has backed my ipod before & synced a few times as well, but not the o.g. op system used from the beginning (the very initial set up done on the ipod) it works fine, but DOES give me the warning "updating to 5.0 willdelete some of your apps & media, including ...  ....will only preserve contacts, calenders," ....etc.
    MY HUGE CONCERN IS if i do hit update & go through w/it, & not having been able to sync it to the one normally used to sync my ipod, will that back up i made be able to restore my game seetings, GAME SAVES, & data achievement type information....?
    please, i'm very hesitant to go through w/it, so if you can please help me out here & let me know asap.....i canimagine you're all busy busy, so  i thank you for your time here w/this
    thank you
    mike z
    [email protected]

    Not that hard. One the computer you are using do the following:
    - Transfer iTunes purchases.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    - Transfer other music using a third-party program like one of those discussed here.
    Copy music
    - If you have synced photos you need a paid program like TouchCopy or PhoneView
    - When all the media in on the computer, connect the iPod to the computer and make a backup by right clicking on the iPod under Devices in iTunes and select Back Up
    - Restore the iPod from that backup.
    That computer is now your syncing computer. Note that the iPod backup that iTunes makes does not included synced media like apps or music.

  • My husband bought an iPad 2.  I have a Mac.  ITunes is in my name but I have turned sharing on.  When we updated to OS5 we lost all the free apps that he downloaded in his user name.  Is there no way to update using my iTunes without losing his software.

    My husband bought an iPad 2.  I have a Mac.  ITunes is in my name but I have turned sharing on.  When we updated to OS5 we lost all the free apps that he downloaded in his user name.  Is there no way to update using my iTunes without losing his software.  He is frustrated using the iPad because he never knows whether to use his user name or my user name.

    Apps are only tied to one account... You can set up two iTunes accounts on your computer, however, and let his iPad sync to his account. If he has never backed up his apps to a computer, however, he will have to redownload all the apps. Afterwards, he can backup to iCloud instead of your computer.
    http://support.apple.com/kb/ht1495

  • How can I script Adobe Reader updates using vbScript, PowerShell or C#?

    I would like to script Adobe Reader updates using vbScript, PowerShell or C#, are there any Adobe API calls I use to do this.  There are several different version that I support and auto update is not an option. I do updates at a specific time of the month. I would like to write a script that would download and install the update for the currently installed version of Adobe Reader (32 or 64 bit) for the version of the OS (32 or 64bit). I can detect the OS version and the Adobe version.  I can download updates but I do not want to hard code anything

    Sabian is correct.
    Most admins download the updates from the ftp site and push via AIP, GPO, SCCM, or some other method whenever it makes sense for them.
    Ben

  • Document Flow not updated using BAPI_GOODSMVT_CREATE

    Hi Experts,
    I am using BAPI_GOODSMVT_CREATE for doing PGR of an inbound delivery.
    Material Document(mblnr) is getting populated but Document Flow of that inbound delivery is not getting updated.Its status is Open.
    Can anyone knows how Document Flow can be updated using BAPI_GOODSMVT_CREATE??
    Regards,
    Puja.

    Hello Puja,
    Goto transaction SPRO, Go to Logistics Execution - Shipping - Basic shipping Functions - Configure Clobal Shipping Data, In this put a tick on Document Flow Update.
    Also refer to the below OSS note.
    http://service.sap.com/sap/support/notes/199703
    Regards,
    Thanga

  • Insert & Update using Writeback in a single Report

    Hi,
    Here is requirement:
    In the single report where the user has to do the Insert & update using the writeback functionality.
    below is the XMl:
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="SUBMITBUTTON">
    <XML>
    <writeBack connectionPool="CSDK">
    <insert>INSERT INTO HSCRTARGETLOOKUP(SLA_TYPE,TARGET_AVAILABILITY,TARGET_MTTR) VALUES ('@{c0}', @{c1}, @{c2})</insert>
    <update>UPDATE HSCRTARGETLOOKUP SET TARGET_AVAILABILITY = @{c1}, TARGET_MTTR = @{c2} WHERE SLA_TYPE = '@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Can you please let us know whether both insert & update will work at the same time using a single report.
    Thanks in Advance
    Siva

    Hi,
    Insert & update is working with the Single xml file:
    here it is how i have done:
    in the 1st criteria i have taken three columns and made union with the 3 dummy columns.
    in the 1st dummy column: CASE WHEN 1= 0 THEN HSCRTARGETLOOKUP.SLA_TYPE ELSE NULL END
    2nd dummy column: CAST('' AS INT)
    3rd dummy column: CAST('' AS INT)
    below is the single XML file which is working for both insert & update
    <?xml version="1.0" encoding="utf-8" ?>
    <WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
    <WebMessageTable lang="en-us" system="WriteBack" table="Messages">
    <WebMessage name="STATES">
    <XML>
    <writeBack connectionPool="XXXX">
    <insert>INSERT INTO HSCRTARGETLOOKUP(SLA_TYPE,TARGET_AVAILABILITY,TARGET_MTTR) VALUES ('@{c0}', @{c1}, @{c2})</insert>
    <update></update>
    <update>UPDATE HSCRTARGETLOOKUP SET TARGET_AVAILABILITY = @{c1}, TARGET_MTTR = @{c2} WHERE SLA_TYPE = '@{c0}'</update>
    </writeBack>
    </XML>
    </WebMessage>
    </WebMessageTable>
    </WebMessageTables>
    Hope it works for you also.

Maybe you are looking for

  • Error in installing CS5

    Hello, I have tried to install CS5 in my MacBook Air OS 10.8.5 I installed all the programs  Bridge, Device Central, Extension Manager, Illustrator, InDesign, Media Encoder, Photoshop but I do not succeed in installing Acrobat X Pro: I have tried 2 t

  • SD-ABAP:Create SO:BAPI_SALESORDER_CREATEFROMDAT2: Line Item Structure Tab

    Hi SD-ABAP, I'm currently creating SO using BAPI_SALESORDER_CREATEFROMDAT2. I'm populating the following: IMPORT:   SALESDOCUMENTIN, ORDER_HEADER_IN, ORDER_HEADER_INX TABLES:  ORDER_ITEMS_IN, ORDER_ITEMS_INX,                 ORDER_PARTNERS,          

  • Table Maintenance events and field focus

    Hi all, In event 01(save data) of table maintenance, I have the code to ensure some fields are not left blank: When testing the creation of table records in SM31, it gives me the error msg successfully, but after that greys out all fields in that row

  • Is it possible to export my outlook contacts to my macbook address book?

    Hi! I am trying to export my outlook contacts to my MacBook address book, is it possible or should I type every contact again? thanks!

  • Office integration in DMS.

    Hi I want to write a program to view and change documents uploaded through DMS(tr CV01n,CV02n,CV03n). Can anyone help me with a progarm or share some knowledge regarding how to implement these requirement. Is there any class or function module to ope