Commit Changes Before Updating

Hi
I know this request sounds strange but I have a master-detail block where the records in the detail block are all checked for completion dates/module status etc before the master block field 'Project Status' is set to 'Completed'.
So for instance if I have 3 detail records - and one is not set to finished - when I try to set master to 'Completed' I have a count which counts the detail records then counts the detail records with 'finish' set and then compares them, if they don't match (one or more status is not set) then a message is displayed telling user to set status before trying to set the whole project to 'Completed'.
I cannot figure out where to put a commit in because I need the detail record changes to commit before I then retry and set the project to 'Completed' but after I make detail record changes, so that the count is counting the change to the records BEFORE i try and complete project record.
So I can't put it in when validate, and when I use commit in when new record instance in detail block then the changes will commit the first time but if I cycle the status on the detail record more than once, the when new record doesn't fire and commit, so I have to consider that a user may cycle through the record twice in one go and this means the commit won't fire.
Can anyone suggest where I could commit after validation on the detail block but before I change master record?
Thanks
User605593
Edited by: user605593 on Nov 21, 2008 1:51 AM

You can do this using POST, but i would suggest a different approach.
You can use formula-items to achieve this without any need for commiting anything before the data is valid:
Create a new non-database-item IS_FINISHED in the detailblock, set calculation-mode to formula and set the formula to:
CASE WHEN :BLOCK.STATUS='FINISHED' THEN 1 ELSE 0 ENDAdjust :BLOCK.STATUS and 'FINISHED' to appropiate values.
Create a control block and put two items (COUNT_TOTAL and SUM_FINISHED) in their. Set calculation mode for both items to "Sum", set calculated Block for both items to yout detauil-block,
set summary item for COUNT_TOTAL to your PK-Item in the detailblock and summary-function to COUNT.
set summary item for SUM_FINISHED to your IS_FINISHED-item in the detailblock and summary-function to SUM.
Now you can just check the two fields COUNT_TOTAL against SUM_FINISHED, if they are not equal there is an unfinished item.

Similar Messages

  • How to check an item in a database block has changed before updating

    hi,
    i have a database block having designation and other relative field are there . a ctrl item status (checkbox) in the same block. i want to update records only the status is marked as ticked get updated. what trigger in which levels should be used
    thanks in advance

    In genral forms marks the records as "changed" by itself. If you want to override this "marking", you'll have to overrwrite the DML-logic (for you cannot change the status of the record back to QUERY). So, you have to create ON-INSERT, ON-UPDATE and ON-DELETE-triggers and do something in it like
    IF :BLOCK.MARKED='Y' THEN
      UPDATE_RECORD;
    END IF;

  • Unable to read changes before commit

    I have a mix of insert and select statements for a particular transaction operation.
    I need to insert to table 1 a set of five records. ie. five inserts to table 1.
    Then i need to sum up a column in table 1, this may have certain records which were inserted recently and some might be older ones.
    This sum needs to be inserted into another table 2.
    In my code i maintain the sequence of inserting, fetching the sum and inserting. I confirm the sequence by giving System.out.println().
    But since everything runs inside a container managed external transaction controller.
    Even though i see the System.out.println's in proper sequence, the suming query is happening before.
    At the end, i have Before JTS completion, followed by my insert sqls, followed by After JTS completion.
    Clearly the problem is, the fetch is happening before i insert, in JTS.
    So how do i make sure, that the fetch happens after my first insert.

    I assume that you are using the TopLink UnitOfWork. The UnitOfWork defers committing all changes to the database until the commit (beforeCompletion in JTA), so any queries you perform will not see any of these changes until after the commit. It does this to optimize the commit, maintain referential integrity, avoid deadlocks, avoid holding pooled connections, etc.
    You must either:
    - perform the inserts and the sum query in two separate transactions
    - compute the sum from the objects in memory
    - use a database session and insertObject instead of a unit of work
    To compute the sum in memory you may wish to use a conforming query in TopLink to query the new objects that have not yet been inserted to the database.
    In the 10.1.3 release, there will be support for a non-deferred unit of work, and a writeChanges() unit of work API to write changes before the commit.

  • HT5622 iPhone is stuck on old ID and won't let me change the ID to get into Cloud segment of Settings.  Need to get this straight so I can backup to Cloud before updating to new System

    iPhone is stuck on old ID and won't let me change the ID in settings to get into Cloud.  Want to sync phone to Cloud before updating the Systems.  No such problem on other phone or 2 iPads linked to account.  Help!

    Thanks Bob,
    That was just a typo.
    I have three accounts set up in Mail, one of which, apart my the username which is my son's, has exactly the same settings as the one that isn't working and remember it's affecting all my devices.
    I would feel happier even if I could create a fourth account on my MacBook Pro using what I know to be the correct password for the server but when I try it keeps defaulting to imap type, I don't get an option for Pop which is what I need.
    Oh Bum.
    K

  • Before updating my iphone 3G to iOS 5 all the photos i synced were lpaced in my photo gallery only. Know I have both Photo gallery and The folder I synced

    Before updating my iphone 3G to iOS 5 all the photos i synced were lpaced in my photo gallery only. Know I have both Photo gallery and The folder I synced. Can somebody help me and tell me how can i have it the old way? if its applicable. Thank you

    Hi Urs
    I searched a lot and maybe found a part of the reason for this high data traffic.
    I'm synchronizing my contacts, calendar & reminder with iCloud & my mail with Hotmail.
    When push is activated for Hotmail, that doesn't matter, but when push is activated for iCloud, the amount of data nearly explodes. So I turned iCloud to manual and let Hotmail on push.
    Contacts, calendar & reminder are synchronizing when opened (I think this is enough).
    Also I do a backup on iCloud and than I deactivate the function (I do not delete the last backup, I only deactivate the option for automatic backup).
    It seems, that the backup functionality also generates traffic when not on WiFi - especially at night!!
    The battery life has been getting better, when I deactivated the support for automatic time zone changes (location services were always on).
    The battery finaly got MUCH BETTER since the update on iOS 5.0.1.
    My traffic is actually higher than on iOS 4 but not so high as before I deactivated some services...
    I hope this info is a little help for you!!
    Let me know if this works for you, ok?
    Best regards,
    Wolfgang

  • Problem in actions change before ear retro date 1.4.2011 acc to controlreco

    HI Experts,
    Got an issue while performing an action "International assignent reentry".
    One of my employee has returned from international assignement.While performing an action   "International assignent reentry"
    i am getting an error  "Change before earlist retro date 01.04.2011 according to control record ss".It is showing while updating the payroll area and personnel subarea in 0001 IT.
    We are trying to do action with the date 15.07.2011.
    In pu03  earliest pers. RA date mentioned as 01.04.2011,earliest MD change,bonus change as 15.07.2011.
    In control record ..earliriest retro accounting period as 01 2011 which is April 2011.
    Now control record is on Exit mode.
    Please advice me to resolve the problem.
    Regards,
    Sairam.

    HI
    Thanks for the reply.If we remove  the  date in earliest per. retro accounting..what are the implications.
    in pu03 ..earlist pers. RA date is maintained as 01.04.2011
    We are doing an action with efective from 15.07.2011.
    Why the system is showing an error ""change before earliest retro date  1.4.2011 acc to control record to PY area ss.""
    After deletion of date in the field of Earlist pers. RA date from puo3 ..after doing the action..shall we put the date as 01.04.2011 in the fiels.
    Please advice.
    Sairam.
    Even after deleting the  Earl. pers RA date also ..we are getting the same error.
    The payroll control record is in exit mode.
    Please advice.
    Sairam.
    Edited by: sathyasairam on Jul 18, 2011 1:54 PM

  • How to count the number of Rows to be Updated before Update takes place..

    Hi all,
    I have a requirement, where i have to count the number of rows to be updated before updating it. SQL%ROWCOUNT gives the no. of rows updated ( after update takes place). How do i get to know the count of no. of rows to be updated/inserted/ deleted. I was looking for a simple solution, as above SQL%Rowcount. But i couldn't find any. I can use a Function and Return the value which will give me number of rows to be updated, But is there any Simple Logic other than this.. or any count function. Your Help is Appreciated. Thanks!

    If you really want to do this (I have no clue why you would need it), then you can piggy back on any existing pessimistic locking you may already have in place.
    However, it would require two loops through the records of which you want to know the count before you update, and a second pass to update them.
    I would really re-think the need for this, though.
    SQL> create table t0304(c number);
    Table created.
    SQL> insert into t0304 select rownum from all_objects where rownum <= 10;
    10 rows created.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
             2
             3
             4
             5
             6
             7
             8
             9
            10
    10 rows selected.
    SQL> declare
      2    cursor mycursor is select * from t0304 where mod(c,2) = 0 for update;
      3    i number := 0;
      4  begin
      5    for r in mycursor loop
      6      i := i + 1;
      7    end loop;
      8    dbms_output.put_line(i);
      9    for r in mycursor loop
    10      update t0304 set c = c + 20 where current of mycursor;
    11    end loop;
    12  end;
    13  /
    5
    PL/SQL procedure successfully completed.
    SQL> commit;
    Commit complete.
    SQL> select * from t0304;
             C
             1
            22
             3
            24
             5
            26
             7
            28
             9
            30
    10 rows selected.
    SQL>Edited by: Steve Howard on Mar 4, 2011 5:57 PM

  • VOWizard-Bug: WHERE Clause not modified on EO add if manually changed befor

    VOWizard-Bug: WHERE Clause is not modified on adding a EO (with association) if it was manually changed before
    Testcase:
    - Create a VO based on 2 EO (Association already defined) --> Jon in WHERE Clause automatically created by Wizard
    - Then modify the WHERE clause, e.g. change an equal to outer join.
    - All works fine.
    - Then add a EO (also Association defined) and chose some attributes.
    - Test and wonder why there are much more rows in the result than expected.
    - Look into the Query-Tab and control the WHERE clause: Wizard forgot to add the new join... and therefore we get a cartesian product between the old view and the new added EO...
    Possible solutions to fix the Bug:
    1. add the JOIN ;-)
    or
    2. at least display a warning that the JOIN is not automatically created!
    Regards, Markus
    GE Medical Systems

    Hi Markus-
    Once the where clause has been customized, we don't update it in the interest of not messing up the user's custom code. However, we should probably warn the user in the types of cases you mention above that he will need to update the where clause manually to include the new information. We will add this in a future release.
    Thanks,
    Ray

  • Can I see the budget of unread emails on ipad and iphone before update?

    Hello everyone.
    I would like to know if I can see the budget of my unread e-mails on ipad and iphone before update.
    That is, I turn on my ipad or iphone and see immediately if and how many unread messages I have.
    Thank you!

    If you go to Settings>Notification Centre>Mail each of your email accounts will appear here separately. You can then change if Badges are displaye on the Mail App - which will show you the number of emails - or not.
    Regards,
    Steve

  • How to lock a row before update using UPDATE statement ?

    I want to lock a row before updating using the UPDATE statement! is there any "reserved word" that I can append to an update statement so, that the row get locked!, also, will the lock gets released automatically once the update is done or do I have to explicitly release the lock?
    how can I do this ?
    any help is greatly appreciated.
    Thanks,
    Srini.

    For detail information, see http://otn.oracle.com/doc/server.815/a67779/ch4l.htm#10900
    The lock will be released by "commit".
    FOR UPDATE Examples
    The following statement locks rows in the EMP table with clerks located in New York and locks rows in the DEPT table with departments in New York that have clerks:
    SELECT empno, sal, comm
    FROM emp, dept
    WHERE job = 'CLERK'
    AND emp.deptno = dept.deptno
    AND loc = 'NEW YORK'
    FOR UPDATE;
    The following statement locks only those rows in the EMP table with clerks located in New York. No rows are locked in the DEPT table:
    SELECT empno, sal, comm
    FROM emp, dept
    WHERE job = 'CLERK'
    AND emp.deptno = dept.deptno
    AND loc = 'NEW YORK'
    FOR UPDATE OF emp.sal;

  • After i update my ipad 2(wifi 3g/64g) to ios 5.0.1..everything works ok except 3g  can not connect to internet.. in the top of my ipad screen it show 3g sign..before update the 3g was working ok

    after i update my ipad 2(wifi+3g/64g) to ios 5.0.1..everything works ok except 3g  can not connect to internet.. in the top of my ipad screen it show 3g sign..before update the 3g was working ok

    i am at SAUDI ARABIA and the Service Provider is (STC) i found that the APN setting has to change from (jawalnet.com.sa ) to (afaqwireless.com).. NOW 3G OK

  • Before update for each row.

    hi,
    SQL> SELECT *FROM EMP WHERE EMPNO=7654
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1450     1587.5         30
    Alter Table EMP Add (
      Constraint PK_EMPNO Primary Key (EMPNO)
       Create Or Replace Trigger tr_emp_rec before update On emp For Each Row
       Declare
        Lv_n Number;
        Begin
       Dbms_Output.put_Line('old'||' '||:Old.empno||' '||'new '||:New.empno);
      End;
    SQL> update emp set empno=7654
      2  /
    old 7654 new 7654
    old 7698 new 7654
    old 7782 new 7654
    update emp set empno=7654
    ERROR at line 1:
    ORA-00001: unique constraint (SCOTT.PK_EMPNO) violatedWhy the trigger body executed three times?.
    Regards
    Ravikumar.A

         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          8003 MARTIN     SALESMAN        7698 28-SEP-81       1450     1587.5         30
          8004 WARD       SALESMAN        8000 08-SEP-81       1700        450         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1450     1587.5         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       3050      427.5         30
          7782 CLARK      MANAGER         7839 09-JUN-81       2650      367.5         10
          7788 SCOTT      ANALYST         7566 09-DEC-82       3200        450         20
          7839 KING       PRESIDENT            17-NOV-81       5200       8250         10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1700        225         30
          7876 ADAMS      CLERK           7788 12-JAN-83       1300        165         20
          7900 JHONE      CLERK           7698 03-DEC-81       1150       85.5         30
          7902 FORD       ANALYST         7566 03-DEC-81       3200        450         20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1500        195         10
          8000 SMITH      PRESIDENT            17-NOV-81       5200       8250         10
          8001 WARD       SALESMAN        8000 08-SEP-81       1700        450         30

  • Cannot commit changes: [SQL0204] OPENCUT99 in C104504M type *FILE not found

    Hi,
    Just i have created an browser application to see an AS400 file,also I have been followed the Developer book to UPDATE this file but I'm ready to update I'm getting this message
    Cannot commit changes: [SQL0204] OPENCUT99 in C104504M type *FILE not found
    someone can helpme with this issue

    This is the more appropriate place for this but it is a crosspost:
    http://forum.java.sun.com/thread.jspa?messageID=4467711

  • [svn:fx-trunk] 13299: fix the _rb swc so that it updates properly when changes happen - update=" true" so that it will compile correctly when using locales

    Revision: 13299
    Revision: 13299
    Author:   [email protected]
    Date:     2010-01-05 19:07:45 -0800 (Tue, 05 Jan 2010)
    Log Message:
    fix the _rb swc so that it updates properly when changes happen - update="true" so that it will compile correctly when using locales
    QE notes: ensure it contains a catalog.xml file, a swf, and a locale directory with properties file
    Doc notes:
    Bugs: https://bugs.adobe.com/jira/browse/SDK-24802
    Reviewer: pete
    Tests run:
    Is noteworthy for integration: no
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24802
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/build.xml

    I've dropped my guard before with the security and I had so much trouble with my computer because of all the people trying to attack my computer I just can't take the chance again.  www.MySafetyGates.com

  • Validating changes before saving

    Hi all
    Sorry if this sounds like a novice question but I am still learning.
    Just wondering if their is a way to validate data in the form before committing; this is in order to display certain checks and present the result via a message display on the form.
    Currently, I have to make the change and then commit the changes before the form will validate and the message is displayed.
    Thanks for any suggestions...
    Newbie

    Hi
    There is a few things i'm validating e.g. one lov
    with 2 choices; if one choice is picked then another
    field in that block is checked for a correct format,
    pick the other choice and the first check is
    cancelled and another field again is checked for a
    certain length value etc.It seems as if you want to do some validations as soon as some value is selected by LOV for an Item.
    If this is the case you can use WHEN-VALIDATE-ITEM trigger for that Item and then set and validate your requirements depending upon the value selected from LOV.
    Hope this is what you are looking for and helps u.
    Regards
    Arif

Maybe you are looking for

  • Can't get the partition disk back

    So I basically want to remove my windows 7 on my macbook air 2013 I followed the instruction until the last step it should be restore, but during the process something went wrong and it just stopped, and quitted. Now I could not restore my drive spac

  • Remote access Time Capsule using Windows Vista

    Hello I ve tried to connect TC remotely using a VPN connection but i ve failed. Does anyone knows how can i do that? Thanks

  • Changing images with c#

    Hi, I am making a slotmachine. I have everything but only need an animation for changing the images. This is what i got(only the code for the animation). I can change 2 images but don't know how to do it with multiple images like 5. using System; usi

  • ESXi 4.1 NIC Teaming's Load-Balancing Algorithm,Nexus 7000 and UCS

    Hi, Cisco Gurus: Please help me in answering the following questions (UCSM 1.4(xx), 2 UCS 6140XP, 2 Nexus 7000, M81KR in B200-M2, No Nexus 1000V, using VMware Distributed Switch: Q1. For me to configure vPC on a pair of Nexus 7000, do I have to conne

  • How to create a single invoice from several delivers? (BAPI for VF01)

    Hi all, I want to create a single invoice from several delivers, just like VF01. I just tried BAPI_BILLINGDOC_CREATEMULTIPLE, and the problem is that this bapi creates an invoice for each deliver, and i need to create only one invoice. Can you tell m