Need to make date validation to remove overlab

I have a problem in date validation
I will tell you the scenario
I have department table as a master table and under this department there is some teachers.
Eeach teacher have Start Hiring Date and End Hiring Date .
I want to prevent to insert a new teacher with Start Hiring date or End hiring date between any period inserted before in this department .
This means in any period there is only one hired teacher
how can I do this validation

Assumed that you are using ADF BC, I reproduced your use case, and tried this. you can also try it,
    CREATE TABLE test_department
    (      id      numeric(10)      not null,
         name      varchar2(50) not null,
         CONSTRAINT dpt_pk PRIMARY KEY (id)
    CREATE TABLE teachers
    (      id      numeric(10) PRIMARY KEY     ,
         dept_id      numeric(10)      not null,
          start_date date,
          end_date date,
         CONSTRAINT fk_emp  FOREIGN KEY (dept_id)
           REFERENCES test_department(id)
insert into test_department values (1,'Math');
insert into teachers values(1,1,to_date('1/1/2010','DD/MM/YYYY'),to_date('31/12/2010','DD/MM/YYYY'));add a validate entity method to you TeacherImpl class.
    public boolean validateTeachers()
        TestDepartmentImpl deptImpl = this.getTestDepartment(); // TestDepartment is the accessor name exposed in TeachersImpl class
        RowIterator iter = deptImpl.getTeachers(); //Teachers is the accessor name exposed in DepartmentImpl class
        boolean flag = true;
        while (iter.hasNext())
                TeachersImpl currentTeacher = (TeachersImpl)iter.next();
                if (!currentTeacher.getId().equals(this.getId())) //skip the current teacher from comparison
                    if (this.getStartDate().compareTo(currentTeacher.getStartDate()) >
                        0 && this.getEndDate().compareTo(currentTeacher.getEndDate())<0)
                          flag=false;
        return flag;
    }

Similar Messages

  • Need help in date Validation Urgent

    Hi ,
    We need help in Date Validation.
    we have 2 Date fields on the form Start Date, End Date
    The requirement is: End Date (May not be greater than 30 years from the start date).
    I have written following script on End Date Exit event. But the problem is its calculating 30 years from the Current Date not from the Start Date
    var tDate = util.scand("mm/dd/yyyy", new Date());
    var M = tDate.getMonth();
    var D = tDate.getDate();
    var Y = tDate.getFullYear();
    var SRes = util.printd("yyyy-mm-dd", new Date((Y+30), M,D) );
    //app.alert(SRes)if (SRes <= this.rawValue){
    app.alert("May not be greater than 30 years from the start date")
    xfa.host.setFocus(
    this);}
    can someone please help me
    Regards,
    Jay

    Hi,
    You'll need to get javascript date from LCD field, and calculate & compare with the future date in javascript date.
    try following script;
    var sDate = StartDate.rawValue;
    var wkStartDate = util.scand("yyyy-mm-dd", sDate);
    var nYear = wkStartDate.getFullYear();
    var nMonth = wkStartDate.getMonth();
    var nDay = wkStartDate.getDate();
    var wkFutureDate = new Date(nYear  + 30 , nMonth, nDay);
    sDate = EndDate.rawValue;
    var wkEndDate = util.scand("yyyy-mm-dd", sDate);
    if (wkEndDate.getTime() > wkFutureDate.getTime()){
      xfa.host.messageBox("May not be greater than 30 years from the start date");
      xfa.host.setFocus(this);

  • Need to make data driven ssrs subscription?

    spent hours on thickets this week
    Mike Monday 2.00
    Tuesday 2.00
    Mark
    Monday 3.00
    Tuesday 4.00
    Lucy
    Monday 6.00
    Tuesday 7.00
    Hello how can I make a data driven subscription which go mike's info to mike only mark info to mark only like that is there any sample code vailable for situation like this sssrs data driven subscription?

    Hi MarkSubedi,
    Based on your description, you can create an Data-Driven subscription and send email based on the different user you have selectted in the Parameter "UserName" in the report.Before create the data_driven subscription,
    please make sure your SSRS edition will support it (Enterprise, Businness Intelligence), More Details:Features Supported by the Editions of SQL Server
    Data-Driven subscription indeed can do this. A data-driven subscription can provides a way to use dynamic subscription data that is retrieved from an external data source at run time. It can deliver the report to different destinations,
    each of which might receive a different render format of the report and a different set of parameter values on a recurring basis. You must also have a relational table that stores the mapping between destinations(e-mail address or a file share),report settings
    and parameter values.
    I have tested on my local environment and we can create an subcription delivery table to include an column for the User name and another column for the User related e-mail addresses.When you creating the Data-Driven subscription,you can configure
    the subscription by provide the query to this table and assign the values in the query results to special settings in the subscription. Please find the Subcription delivery table you need to create and the steps of Data-Driven subscrition configuration of
    using this table.
    Subcription delivery table(when you want to modify UserName and e-mail address you can just modify this table but don’t need to do modification in the Data-Driven subscription):
    CREATE TABLE TableName
    (UserName nvarchar(50),
    Mailto nvarchar(50))
    INSERT INTO TableName
    ('Mike','[email protected]'),
    ('Mark','[email protected]'),
    ('Lucy','[email protected]'),
    Details steps of Data-Driven subscrition configuration of using this table:
    Specify a data source that contains the subscription delivery table which created like above.
    Specify a command or query that return the list of the user name and the e-mail addresses and then click "Validate" button  to make sure query validate successfully, click next.query that return the list of the user name and the e-main addresses
     select * from TableName
    Specify delivery extension settings for Report Server Email :in the dropdown list select the "Mailto" from TableName, click next.
    Specify report parameter values for Report, Check as below and the e-mail will send based on each UserName, click next.
    Specify when the subscription is processed  by setting the schedule details, click Finish.
    Below article for your reference about details steps of
    Create Data-driven Subscription:Create Data-driven Subscription Page (Report Manager)
    If you still have any question, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • How to make "Data Entry Profile" field input unable or display only in CAT2

    hi ,
    I have requiremnet where I need to make "Data Entry Profile" field in the CAT2 transaction as Display only .That is for each user it should come as default one .
    The reason behind this is , user should not change this Profile and maintain an incorrect timesheet entries.
    Is there any User exit where i can do this ? 
    Let me know as this is very urgent requirement.
    Points will be definately rewarded.
    Thanks .

    Hemant,
    Got SHD0 transaction and create screen variant for that transaction there you can disable that field.
    Create Transaction variant for that transaction and assign previously created screen variant to this transaction varient. actiavte.
    Reward if it helps,
    Satish

  • Data Validation in IP before saving

    Dear All,
                  I need to do data validation in IP layout, before data gets saved into cube. For example, i have percentage key figures to plan, which should sum up to 100. if it is not, on clicking on save button, user should get proper error message.
                   Is there any ready made planning function available which does this simple data validation? else, please suggest any other approach to achieve this.
    Thanks,
    Harpal

    Hi Harpal,
    Create a Custom Planning function to check the Percentage and return the expected message.
    for reference : look at class : CL_RSPLFC_CREATE_CR
    it should use syntax :
          if sy-subrc <> 0.
            message enum(messageclass ) with x.
          endif.
    Please let me know if you need further help.

  • How to make data base link from oracle 11g r2 to microsoft sql 2008 express

    I need to make data base link from oracle 11g r2 to microsoft sql 2008 express to make replication between then
    please help me !
    I didn't know what is the user and password in the command which create database link

    To replicate data you can ude Database Gateway for ODBC or Database Gatewy for MS SQl Server. Please use the search engine of this forum if you ant to get more details about each product.
    Some SQl Servers are set up to use Windows authentication only. In this case you won't be able to connect to the SQL Server as Windows authentication isn't supported with the gateways. You have to make sure your SQL server is supporting username and password authentication - a common user is the "sa" user. Regarding the username/password, please get in touch with your SQL Server Admin.

  • Data Validation - a feature that Numbers really needs.

    Right now, the newly purchased Numbers app for iPad/iPhone is little more than a crippled document viewer for me because numbers doesn't support 'data validation' (as implemented in excel).
    Its not a hard concept and likely utilized in a LOT of spreadsheets on the planet.  Not supporting such a critical feature is a problem, as it makes numbers, at least for me, rather pointless as an authoring tool since I cannot change or update data in my worksheet without likely corrupting the document's data integrity.
    Hopefully, someone at Apple is working on fixing this.
    Given that one cannot use data validation - how do I lock down a spreadsheet so I don't accidentally change cell contents?
    The fact that there is no 'undo' button on the iPhone version that I do get on the iPad (same app) makes it worse.. I'm occasionally and unintentionally dragging selections of stuff around the page really hosing up the iPhone spreadsheet.
    So I need to just remember what needs to be updated, update the excel spreadsheet when I can, then delete the iWork-iCloud doc, upload the replacement, then refresh the iPhone/iPad version.. very cumbersome and not at all 'cloud-like' or usefull.
    Apple developers.. are you paying attention?

    Yeah I know that apple likely has the same system as Microsoft in sending general support to a forum such as this. And maybe thae same stupid moron that not paying attention to the forums if their users is a food idea.
    That doesn't change the point of the issue nor that apple directs ,e here to ask said question
    Written in the iPad split soft keypad that covers up the forum post I'm typing. Joy

  • Need to make a dff field read only if it has data

    Hi,
    we added dffs to the manage sites page, i am extending the controller to do some validations of this DFF page. I need to make dff read only if it has some data. The following code is not working.
    public void processRequest(OAPageContext pageContext,OAWebBean webBean)
    super.processRequest(pageContext,webBean);
    OAApplicationModule xam = paramOAPageContext.getApplicationModule(paramOAWebBean);
    OAViewObjectImpl DffVO = (OAViewObjectImpl)xam.findViewObject("SitesFlexVO");
    OAViewRowImpl DffRow = (OAViewRowImpl)DffVO.getCurrentRow();
    if(DffRow.getAttribute("Attribute1")!= null)
    OADescriptiveFlexBean dffBean = (OADescriptiveFlexBean)webBean.findChildRecursive("Attribute1");
    dffBean.setReadOnly(true);
    can you please suggest whats wrong and give me a correct solution.
    Thanks,
    Kiran M.

    Thanks for the reply nani,
    it didnot work, i am getting the following exception.
    ## Detail 0 ##
    java.lang.NullPointerException
         at xxtjx.oracle.apps.pos.supplier.webui.XXTJXByrMngSiteDFFCO50.processRequest(XXTJXByrMngSiteDFFCO50.java:43)
    The error line 43 in my code is
    dffBean.setReadOnly(true);
    so i feel there is something wrong with this command. I kept this validation in process request and i am able to fetch attribute values in process request. so i feel there is no issue fetching the attribute value. i feel its the issue with the set command.
    Let me know if you have any other solution.
    Thanks,
    Kiran M.

  • How to make custom data validation on standard form.

    Hi,
    I have some little OAF experience. I have extended VO so far but I am still newbie.
    I need to make custom data validation on standard form.
    I Oracle Credit Management module on "Create Credit Application: Applicant" form I need
    to validate chosen currency against customer setup (whether there is customer profile amount for the currency).
    The page is /oracle/apps/ar/creditmgt/application/webui/ARCMCREDITAPPPAGE
    There are controllers on the page:
    oracle.apps.ar.creditmgt.application.webui.creditAppContentFooterCO 115.14.15104.2
    oracle.apps.ar.creditmgt.application.webui.creditApplicationPageCO 115.6
    oracle.apps.ar.creditmgt.application.webui.creditAppRegion2CO 115.13.15104.2
    oracle.apps.ar.creditmgt.application.webui.creditApplicationCO 115.8.15104.3
    oracle.apps.ar.creditmgt.application.webui.creditAppRegion1CO 115.28.15104.4
    oracle.apps.ar.creditmgt.application.webui.creditAppBusBackCO 115.6
    oracle.apps.ar.creditmgt.application.webui.OCMApplicantInfoRNCO 115.4
    creditApplicationPageCO is pageLayout controller.
    Please direct me how to achieve it.
    Which controller should I extend (if any)?
    How to get values from the page (customer site id, currency) and how to run custom sql in my CO class ?
    Regards,
    Marcin

    Hi Marcin,
    You have to find your GO button is handled in which standard controller, (if you click on the about this page, you should be able to identify the controller,
    or you can download all the controller .class files and decompile and check the logic).
    Then extend that controller(which has the Go button logic, you can see how it has been handled.),
    The usual way to check is
    if(pageContext.getParameter('<Go button name>') !=null)
    Since you want to validate first your custom validation, in the extended controller ProcessFormRequest
    dont call the super.processFormRequest unless your validation is success.
    Call the super at the end.
    Inside your extended controller you have to find your AM and then your required ViewObject to get the user entered values.
    Thanks,
    With regards,
    Kali.
    OSSi.

  • My iPhone 5s on ios 8.1.2 is stuck at Apple logo or recovery mode.. To fix this issue, i need to update it to ios 8.2 through itunes.. I want to ask that my data i.e. Photos and other personal data would be removed after updating it or not..?

    My iPhone 5s on ios 8.1.2 is stuck at Apple logo or recovery mode.. To fix this issue, i need to update it to ios 8.2 through itunes.. I want to ask that my data i.e. Photos and other personal data would be removed after updating it or not..?
    if yes then how can i save my data or get out of recovery mode.. Is there any safe mode or something like that on which i could access my data..
    P.S. I have not taken any backup of my iPhone on itunes..
    Please help me sort out this issue..

    Recovery mode doesn't mean that all your data is already lost. You only lose your data if you restore it.
    When you plug the phone is into iTunes hold down the home button. iTunes may then give you the option JUST to update the software first. This should not get rid of any data.
    However, if iTunes is only giving you the option to RESTORE and update, then you will lose your data I'm afraid.
    Hope that helps!

  • Need to make a copy/clone of a table which has sdo_geometry data type

    Folks,
    We are running Oracle 11gr1 on Suse Linux platform.
    We have a requirement, where we need to make a copy of a table, in the same database but in a difference schema, the source table has about 130 millions rows and also has the sdo_getometry data type.
    I tried materialized view, but MV does not support sdo_geometry data type.
    According to one of my DBAs, doing it via data pump , will take few days, which is not acceptable.
    Is there a way, we can make a copy of this table in the same db ?
    Thanks
    Ashish

    Siva,
    This is not for backup purpose.
    Here is the background information on this requirement.
    I need to have a static copy of a table, which has spatial column, sdo_geometry in it.
    So we can run another application against this table, just read-only, since we need static data, data in the source table changes quite often.
    One of my DBA suggested to have another instance/database, to keep the copy of the source table, I thought idea of having another database just to keep a copy of a table is an over kill.
    That is why I had asked this question and you had provided a viable solution.
    Then we need to refresh this table , with the data (changes) from the source table, maybe once in 2- 3 weeks.
    I tried creating a Materialized view, but it does not support Spatial columns.
    So now I am trying to figure out, the most efficient way to refresh the clone table from the source table.
    Regards,
    Ashish

  • In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms

    In AP invoice i need to make "Terms date " field to calculate the date automatically when i select the payment terms.
    How can i do this?

    Hi,
    You can select the Payment Term at PO Header Level.
    When you book an invoice, that Payment Term will automatically defaulted to Invoice.
    You can define Payment Term in AP.
    Payment terms have one or more payment terms lines, each of which creates one scheduled payment. Each payment terms line and each corresponding scheduled  payment has a due date or a discount date based on either a specific day of a month, such as the 15th of the month, or a number of days added to your terms date, such as 14 days after the terms date.
    Payment Terms (Oracle Payables Help)

  • Need to Make the DATA Load Faster

    Hi
    I need to load the data from the source to the target like 90 tables. The source has 36 million rows in some of the tables it is taking a long time altough I have dropped the indexes on the target. I really need to make it as fast as possible. Following is the code for 1 table that I am currently using. Any Help would be really appreciated.
    INSERT INTO AAA.CHECKHISTORYITEM@db1 (
    OID,
    AMOUNT,
    BANK_DEPOSIT,
    CHECKHISTORYOID,
    CODE,
    FIELD_NB,
    HISTTYPEOID,
    STATUTORY_DED,
    TAXCODEOID,
    VALIDTILL,
    ABBREV,
    CONVERSION_ID,
    DESCRIPTION,
    EXTERNAL_ID,
    ACTIVE,
    CREATEDON,
    CREATOROID,
    DELTAOID,
    MODIFIEDON,
    SCREEN_TRANSACTION_NUMBER,
    SECURITYOID,
    SHARABLE,
    SUBCLASS,
    TARGETUSEROID,
    VERSION,
    VERSION_NUMBER,
    ACM,
    MODIFIEDBYUSEROID,
    cidn)
    (select
    OID,
    AMOUNT,
    BANK_DEPOSIT,
    CHECKHISTORYOID,
    CODE,
    FIELD_NB,
    HISTTYPEOID,
    STATUTORY_DED,
    TAXCODEOID,
    VALIDTILL,
    ABBREV,
    CONVERSION_ID,
    DESCRIPTION,
    EXTERNAL_ID,
    ACTIVE,
    CREATEDON,
    CREATOROID,
    DELTAOID,
    MODIFIEDON,
    SCREEN_TRANSACTION_NUMBER,
    SECURITYOID,
    SHARABLE,
    SUBCLASS,
    TARGETUSEROID,
    VERSION,
    VERSION_NUMBER,
    ACM,
    MODIFIEDBYUSEROID,
    'ABCD from ABCD.CHECKHISTORYITEM);
    commit;

    Is there any trigger on the table you're inserting? You could consider disabling constraints (in case any exists) if you're sure enough of the data you're inserting and no one else "touches" the table while you're working on it.

  • Need to make "opening date" mandatory in SRM RFx Header Screen

    Dear All,
    Working for SRM component "/SAPSRM/WDC_DODC_RFQ_H_BD" there is field "OPEN_DATE_TIME" which i need to make it mandatory .
    There is standard config to do the same but its not happening through that is there any way I could do the same.
    I have also tried to enhanced the application and made it mandatory in MODIFYVEW method and given the error message also but it allowed the RFx to get publised even tough the date is not entered.
    Really appreciate the same if anyone has come across such requirement.
    Thanks
    Ankit Jain

    In my system works fine, I've added the following code in badi BBP_DOC_CHECK_BADI and I can't publish my RFX without filling that field...
    DATA: ls_bid_header TYPE bbp_pds_bid_header_d,
            ls_messages TYPE LINE OF bbp_tmessages_badi.
      IF flt_val EQ 'BUS2200'.
        CALL FUNCTION 'BBP_PD_BID_GETDETAIL'
          EXPORTING
            i_guid   = iv_doc_guid
          IMPORTING
            e_header = ls_bid_header.
        IF ls_bid_header-open_time IS INITIAL.
          CLEAR ls_messages.
          ls_messages-msgty = 'E'.
          ls_messages-msgid = 'ZYOUR_MESSAGE_CLASS'.
          ls_messages-msgno = 000.
          APPEND ls_messages TO et_messages.
        ENDIF.
      ENDIF.

  • Why does data validation not disappear immediately on protected sheet, bug?

    I have provided a link to a workbook.
    Cell A1 contains data validation. The macro contains one sub that removes the data validation from Cell A1. However, the data validation won't be removed until you first run the macro and then click on another cell and then click on A1 again.
    However, if the sheet was not protected, data validation would get removed immediately by the macro, without the need to navigate to a different cell.
    Why is it like this? Is this a bug?
    Workbook with data validation in A1 of protected sheet and a macro to remove it

    Hi JP3O,
    Base on my test in Office professional Plus 2013 (15.0.4569.1506), it works fine.
    Check the worksheet is protected
    Select A1, the dropdown icon will display
    Run/Debug the macro, the dropdown icon will be disappeared.
    What’s the version of your Office? Could you reproduce that issue in other machine?
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Need a little help with Slimbox (Lightbox clone) and Spry data sets

    Hello guys! First of all let me say that I'm not a programmer in any way, shape or form, and somehow I managed to build me a dynamic thumbnail gallery that reads data from an XML file and displays it on my webpage using a Spry data set and a slider w

  • System configuration for ESS/MSS Implementation

    Hi, I am stuck while configuring the systems for XSS configuration. I have completed following: 1) Installed Portal 7.00 (based on NW2004s) which uses the backend ERP2005 system as a User Master source. 2) Implemented the business packages for ESS 1.

  • GETWA_TOO_MANY_SEGMENTS

    We are using BAPI   'BAPI_INCOMINGINVOICE_CREATE' to post invoices in our system with the help of file record sent by 3rd party. This is done via background job. It runs successful few days and failes on a regular basis throwing error '  GETWA_TOO_MA

  • Can I reload audio books

    Genius Bar told me to erase all to fix no wifi problem.  Will I be able to reload audio books?  Books were backed up to my computer.

  • Syncing Audio & Video is my process wrong

    G5 dual 2.0   Mac OS X (10.4.3)   I am creating video scrapbooks with pics and vid to music. I rough out my length, add my songs. I don't add transitions yet because they make the pics harder to tweek. I Ken Burns the pics as I want, then add transit