2 Replies Latest reply: Nov 30, 2012 10:56 PM by 918319 RSS

    How to restrict overlap between two dates in adavanced table

    918319
      Hi Gurus,

      In advanced table contain two dates are start date and end date .
      For first row i enter start date :08-nov-2011 and end date is 15-nov-2011
      suppose i enter second row:when ever i enter start date in between above two dates 08 to 15 then to raise exception here,only to enter the start date always greater than end date of first row.


      similar way i want check all rows.how to apply the loop condition...kindly send me any one sample code.


      Thanks,
      kumar.
        • 1. Re: How to restrict overlap between two dates in adavanced table
          Sushant Sharma
          Hi,

          You can write this logic in validateEntity() method of the EOImpl.java file.

          Use Iterator to get all instances of EO like:
          Iterator seqIterator = def.getAllEntityInstancesIterator(entity.getDBTransaction());

          then loop through each EO:
          while (seqIterator.hasNext()) {           
          OAEntityImpl entityrow = (OAEntityImpl)seqIterator.next();
          if (entity != entityrow) {
          // your logic here
          }
          }

          --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
          • 2. Re: How to restrict overlap between two dates in adavanced table
            918319
            Thank u Sushanth,


            I can't understand what is 'def',could u give me elaborate code,Please Sushanth.

            Thanks,
            Kumar.