Validate Date Less than Sysdate

I would like to validate Hiredate attribute of my EmployeesEO entity object for which it should not take a date which is greater than sysdate.
I wrote this Groovy script on the Edit Validation Rule dialog of EmployeesEO. But it seems not working:
//perform validation
if(Hiredate > DBTransaction.currentDbTime){
adf.error.raise("DATE_GREATERTHAN_SYSDATE_ERROR")
return false
return true
I am using JDeveloper Studio Edition Version 11.1.1.5.0 and ADF BC.
Please help.
Edited by: Sahar Hassan on 20 Feb, 2012 1:36 AM

Hi,
Have you tried using groovy expression (adf.currentDate) with compare validator
Ex :
    <validation:CompareValidationBean
      Name="Hiredate_Rule_0"
      ResId="model.Emp.Hiredate_Rule_0"
      OnAttribute="Hiredate"
      OperandType="EXPR"
      Inverse="false"
      CompareType="LESSTHAN">
      <validation:TransientExpression><![CDATA[adf.currentDate]]></validation:TransientExpression>
    </validation:CompareValidationBean>-Arun

Similar Messages

  • MIRO posting date less than MIGO / SES posting date

    Hi,
    In our system , user can make MIRO with respect to a PO and give posting date less than posting date of GRN or Service entry sheet. I want that user can give posting date of MIRO document equal to or greater than posting date of GRN / SES of that PO.  How can i do this?
    Regards
    Kalpesh

    Hi,
    Please write a validation in order to avoid the user keying in the pre posting date at the time of MIRO

  • GR date lesser than the PO date, the system should show an error message.

    Dear Gurus,
                         if anybody puts GR date lesser than the PO date, system should display error this happens because the system allows back dated posting of 101 MVT in MIGO.Similarly the IR date should not be less than the GR date. This happens because the system allows back dated posting of MIRO also.
    Regards
    ASHOK K

    Hi,
    Use the badi MB_DOCUMENT_BADI  and compare dates of EKKO-BEDAT and MKPF-BLDAT for MIGO.
    USe the badi IF_EX_MRM_INVOICE_UPDATE PROCESS_AT_ and compare the dates of MKPF-BLDAT and RBKP-BLDAT while saving the invoice for checking the back dated entries and throw an error message.
    Regards,
    Bharat

  • Date less than or equal to 60 days from sysdate

    Hi there!
    I have a doubt about an SQL query, which I don't have any idea on how to proceed.
    I need the SQL to bring data only when 'e.dt_vencimento' is less than or equal to 60 days from sysdate.
    Below you can see my query, and the line I stuck is the #24.
    Thank you already,
    Marcelo Melo
    SELECT b.nr_contrato,
      a.NM_PAGADOR,
      a.NR_SEQ_LOTE,
      a.dt_referencia,
      a.DT_VENCIMENTO,
      a.VL_PRE_ESTABELECIDO,
      a.VL_COPARTICIPACAO,
      a.VL_OUTROS,
      a.VL_TITULO,
      e.dt_liquidacao,
      e.nr_titulo
    FROM pls_mensalidade_wcp_v a,
      pls_contrato b,
      PLS_CONTRATO_PLANO c,
      PLS_CONTRATO_PAGADOR d,
      titulo_receber e
    WHERE b.nr_sequencia  = c.nr_seq_contrato
    AND d.nr_seq_contrato = b.nr_sequencia
    AND a.nr_seq_pagador  = d.nr_sequencia
    AND a.nr_titulo       = e.nr_titulo
    AND c.NR_SEQ_PLANO IN (17, 18, 25, 47, 50, 51,54,56,57,58)
    AND d.cd_pessoa_fisica IS NOT NULL
    and e.dt_liquidacao is null
    --and e.dt_vencimento ***here I intend to write the condition***
    AND a.dt_referencia     =:dt_referencia
    ORDER BY 2

    It sounds like you want
    and e.dt_vencimento <= (sysdate - 60)
    That assumes that you really mean "60 days before sysdate" when you say "from sysdate".  You might intend to say "60 days after sysdate".  And you might mean trunc(sysdate) rather than sysdate in order to ignore the time component.

  • Expression for due date less than today

    hi - i'm trying to compare if the due date of a task is less than today, so that I can automatically mark it as completed.
    any idea what expression I'd use?

    You will have to write a workflow that waits till the due date and then updates it as completed.
    But then what business purpose will it serve? The users will not update the tasks ever.

  • MIRO(Invoice Verification) posting date is lesser than MIGO(Goods Receipt)

    MIRO(Invoice Verification) posting date is lesser than MIGO(Goods Receipt) posting date.
    Explanation:
    Miro sholud be posted after the GRN has posted. It means that the Posting date of Miro should be greater than or equal to the Posting date of Migo. But I am facing the issue that I can able to post the Miro before the Migo date..
    For example:  I have posted the Migo(Goods receipt) document with the posting date u2013 10.8.09 and at the same time I can also able to post the Miro(Invoice Verification) posting date as u2013 5.08.09. This is should not be allowed . Kindly give me the solution. Is there any options in SAP standards to restrict this type of Postings(without using user exit).
    regards
    Varadharaj

    Hi
    you  need to use BADi for this INVOICE_UPDATE
    you can give logic as whil;e MIRO system will compare posting date with MIGO doc , then create a Z error msg in se91 nad assign it in that badi
    take help of ABAPer, check following link
    [LINK |GR date lesser than the PO date, the system should show an error message.;

  • Block AP Invoice less than PO date ( Udf )

    Hi All,
    I am trying to Make an SP based on the UDF which is there in the AP invoice named as PODate. I want to block the AP invoice if AP Invoice Posting Date or AP Invoice Document Date is less than the Date of the this UDF. This UDF Captures the PO date basically and I want to Block all AP Invoice whose Posting Date is less than the PO Date.
    I tried the below SP but could be sucessful.
    ---AP Invoice vs PO Date
    if @transaction_type = 'A' and @object_type ='18'
    begin
    if exists(select T0.docnum from dbo.OPCH T0 where T0.docentry = @list_of_cols_val_tab_del
    and T0.docdate > T0.U_PODATE
    BEGIN
    SET @error = 17
    SET @error_message = N'AP Invoice Date less than the PO Date'
    end
    end
    Kindly advise.
    Regards,
    venky

    Hi Venky......
    Try this.....
    ---AP Invoice vs PO Date
    if @object_type ='18' and @transaction_type = 'A'
    begin
    if exists(select T0.docnum from dbo.OPCH T0 where T0.docentry = @list_of_cols_val_tab_del
    and T0.docdate < T0.U_PODATE
    BEGIN
    Select @error = -1,
    @error_message = N'AP Invoice Date less than the PO Date'
    end
    end
    If you see in your SP you have given reverse condition that is T0.docdate > T0.U_PODATE but it shoudl be T0.docdate < T0.U_PODATE
    ANyways try this SP.......
    Regards,
    Rahul

  • Greater Than Less Than

    Dear all,
    I am Using oracle 10g R2 database on windows.
    I have a doubt that,
    If I have a 'Date' datatype column suppose a and want to (select Less than sysdate and greater than Sysdate-31(One Month).
    e.i.
    select a,b,c from T where a Less Than Sysdate-31(One month.);How can i do this.
    Thanks,
    Chanchal Wankhade.

    Shinegar wrote:
    I had not considered the effect on an index with TRUNC. Thank you for pointing that out.
    TRUNC doesn't actually remove time as you can see below
    SELECT TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH:MM:SS AM') "Today's Date and Time" from DUAL;
    Today's Date and Time
    01/19/2012 12:01:00 AMLet's say sysdate = Jan 19, 2012 11:00:00 AM
    As shown above, trunc(sysdate) = Jan 19, 2012 12:01:00 AM
    So, trunc(sysdate) -1 = Jan 18, 2012 12:01:00 AM
    Removing the trunc from column a
    select a,b,c
    from T
    where a between trunc(sysdate)-1 and trunc(sysdate);will also remove all data that is greater than Jan 19, 2012, 12:01:00 AM so you would only see data from one day -- Jan 18th.
    Adding the trunc to column a returns all the data from Jan 18th and 19th.
    It is my experience that users will ask for a date range, but then will ask for just one day. If Column a is not truncated, then no rows would be returned when between trunc(sysdate) and trunc(sysdate).
    Most programmers will not use trunc(sysdate) in the where clause, but would use a variable with value assigned of sysdate or trunc(sysdate) as it provides more flexibility.
    If you do not want to use trunc on column a, then the where clause should be BETWEEN trunc(sysdate) - 31 AND sysdate.
    Edited by: Shinegar on Jan 19, 2012 12:40 PMThe trunc function does not remove the time portion, but it does set it to midnight. Or at least i would if you used the correct format mask in your TO_CHAR. The mask for minutes is MI not MM.
    SQL> SELECT TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH:MI:SS AM') am_pm,
      2         TO_CHAR(TRUNC(SYSDATE),'MM/DD/YYYY HH24:MI:SS') mil_time
      3  from dual;
    AM_PM                  MIL_TIME
    01/19/2012 12:00:00 AM 01/19/2012 00:00:00John

  • TIME_MANAGER_INFO 1 hour earlier than SYSDATE?

    When one of our processes fails and places the message back on the queue to be retried in 5 minutes time the TIME_MANAGER_INFO is 1 hour + the delay time less than SYSDATE in the database.
    For example, if our message fails at 11am and the delay period is 5 minutes the TIME_MANAGER_INFO is being set to 10:05am when I would have thought it would be set to 11:05am. I'm guessing that wherever the Advanced Queue is getting its time from hasn't been adjusted for daylight savings but where is this set/managed so I can get it in sync with SYSDATE.
    Where is the Advanced Queue getting its time from?

    Just in case anyone else comes across this, we had a bug where the queue state was staying at 1 and was never being reset to 0 once it reached its delay time. In order to "fix" this until Oracle releases a patch that works we wrote our own procedure that would compare the TIME_MANAGER_INFO value with SYSDATE and if it was earlier than sysdate then we set the state to 0 so it would be picked up by the dequeue. Easy. Except that because of the timezone issue the TIME_MANAGER_INFO value was immediately set to 1 hour earlier than SYSDATE so we always set the state to 0 regardless of its delay period. So, we are looking at using the TIMEZONE value in the system.aq$_queue_tables to determine which timezone the queue is using and compare it to the databases timezone to see if we should change the TIME_MANAGER_INFO to something different. At least, that's what we'll probably do.
    select time_manager_info,
    cast( from_tz( time_manager_info, (select timezone from system.aq$_queue_tables where name = 'MY_QUEUE$TAB')) at time zone (select sessiontimezone from dual) as date) t
    from MY_QUEUE$tab qt

  • How can replicate  200Mo with Oilte less than 40 minutes ?

    I would like to know if it is possible to do complete refresh of 200Mo of data less than 40 Minutes ?
    How to do ?
    I did it with wtgpack, webtogo, msync.
    I need more than 8 hours for that.
    Thank you for more information.

    Ther depends merely on the network and the CPU power of the laptop/desktop. There is not much Oracle9i Lite/synchronizaiton can do because the client does a complete refresh. The tuning facilities do only apply when performing a fast refresh.
    Assuming that you want a full refresh only for the very first time (instantiation), you might want to look into a new feature in 5.0.2.1.0 called "Offline Instantiation". The replication server creates the 200mb database for each user on the server (rather over the network) which then can be FTP to the client or even burned onto a CD-ROM.
    There is a readme.txt file in (Mobile Devevelopment Kit) ORACLE_HOME\Mobile\Sdk\Consolidator\OLI

  • Less than or eual to Date issue in dynamic where clause

    Dear All,
    I have a requirement to search the leave balance information, here date as a parameter. When ever we pass the date as a parameter it should be display all the leave balance information till the parameter date.
    Steps I have followed to achieve this requirement
    • Created the VO and query as follows
    SELECT trunc(paa.creation_date) creation_date, paa.date_start, paa.date_end,
    SYSDATE duty_resumption_date, paa.absence_days leave_deducted,
    paa.absence_days leave_added, 'Leave Deucted' detail,
    paa.absence_days balance_remaining,
    fu.user_id
    FROM per_absence_attendances paa, per_all_people_f papf, fnd_user fu
    WHERE 1 = 1
    AND papf.person_id = paa.person_id
    AND papf.person_id = fu.employee_id
    AND fu.user_id=fnd_profile.value('USER_ID')
    And trunc(paa.creation_date) <= TO_DATE((to_char(trunc(to_date(:1)),'DD-MON-YYYY') ),'DD-MON-YYYY')
    •     Created the Advance Search Region
    •     In the controller of the region, I have captured the go button logic and setting the dynamic where clause as below
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
    OAQueryBean oaquerybean = (OAQueryBean)webBean.findIndexedChildRecursive("QueryRN");
    if (pageContext.getParameter(oaquerybean.getGoButtonName()) != null)
    OAViewObject oaviewobject = (OAViewObject)am.findViewObject("XXLeaveBalanceVO");
    String creationDate = pageContext.getParameter("CreationDate");
    oaviewobject.setWhereClauseParam(0,creationDate);
    oaviewobject.executeQuery();
    •     But this where condition is working equal condition to the parameter but it is not working less than condition.
    •     When I am running the VO query in Toad it is working the less than condition.
    Please help me out to resolve this issue.
    Thanks in Advance,
    Sai

    Dear Kumar,
    I have changed my vo query as you suggested, now the equal condition also not working and I am getting the following error message
    JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT trunc(paa.creation_date) creation_date, paa.date_start, paa.date_end,
    SYSDATE duty_resumption_date, paa.absence_days leave_deducted,
    paa.absence_days leave_added, 'Leave Deucted' detail,
    paa.absence_days balance_remaining,
    fu.user_id
    FROM per_absence_attendances paa, per_all_people_f papf, fnd_user fu
    WHERE papf.person_id = paa.person_id
    AND papf.person_id = fu.employee_id
    AND fu.user_id=fnd_profile.value('USER_ID')
    And trunc(to_char(paa.creation_date) ,'dd-MMM-yyyy')<= trunc(to_char(:1, 'dd-MMM-yyyy'))) QRSLT WHERE (( CREATION_DATE = :2 )) ORDER BY CREATION_DATE ASC
         at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
         at OA.jspService(_OA.java:72)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:597)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:521)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
         at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:595)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01722: invalid number
    Thanks,
    Sai

  • Date should not be  less than current date.

    Hello, I have a form.It has an item called end_date. I want to have validation of end_date in such a way that "end_date should not less than current date". Any tips would be helpful.
    Thanks in advance.

    jwellsnh wrote:
    Pravish,
    A dynamic action executing JavaScript can do this:
    Create a Dynamic Action:
    Event Before Page Submit
    Condition JavaScript Expression
    Value $v('P1_END_DATE')<$v('P1_BEGIN_DATE')In this scenario; P1_BEGIN_DATE would need to default to sysdate and could be a hidden item on the page.
    Jeff
    Edited by: jwellsnh on Jul 19, 2012 9:50 AMMaybe I'm missing something but isn't this just a use case for a common-or-garden validation? Would be interested to know why you thought of javascript rather than normal built-in functionality (not meant as a criticism incidentally!) - is javascript your first port of call when it comes to APEX?
    I'd also watch out for comparisons to SYSDATE - remember that SYSDATE includes the current time, so you'd need to take that into account (maybe you could make use of the TRUNC function to remove the time element?). Indeed, would javascript evaluate that expression as comparing two dates (I know Javascript evaluates variables byDuck Typing but does this work in practice)?

  • Validation for posting date is less than 7 days of current date

    Hi
    I want to create a validation wherein  system will validate every entry that whether posting date is less than 7 days of current date. If it is than check in a set is that user id available if not than show error message.
    If someone have any idea on this logic pls share with me.
    Regd
    Shiv

    Hi,
    That's certainly possible via usual OB28 validation. Define your prerequisites for the posting date (you will have to do it via user-exit (bkpf-budat greater then sy-datum less 7 days) , and check whether the user is in the set.
    Regards,
    Eli

  • End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    If you use the exit event, you will probably have to have the same code on both the start and end date fields since they have a dependancy on each other. Maybe better to try the validate event of the end date so that if either field is changed the event gets fired. You can try the following for validate event
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = CON_START_DATE.rawValue
    endDate = $.rawValue
    if ( HasValue(endDate) ) then
        if (stDate > endDate) then
            xfa.host.messageBox("End date is lower than Start date! End date is cleared")
            $.rawValue = null
        endif
    endif
    1
    // End date should not less than Start date, else CLEAR it - End

  • Contract End date should not less than Start date, else CLEAR it

    Hello
    I put CONTRACT START DATE and CONTRACT END DATE fields on the form. These 2 objects (Date/Time objjects) i pulled them from Satndard tab of pallette and dropped on my layout page design, fine.
    Now, am trying to put a validation that the end dat eshould not lower than start date, so, i got a thread as below from Niall,
    http://forums.adobe.com/message/1909551
    and i did my FormCalc coding under EXIT event of END DATE field as below,
    // Pls. note this FormCalc
    // End date should not less than Start date, else CLEAR it - Begin
    var stDate
    var endDate
    stDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_START_DATE") .rawValue
    endDate = xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue
    if (stDate > endDate) then
        xfa.host.messageBox("End date is lower than Start date! End date is cleared")
        xfa.resolveNode("CUSTOMER.Page31_Contracts.Con_Whole_Page.CON_Basic_Info.CON_END_DATE").r awValue = null
    endif
    // End date should not less than Start date, else CLEAR it - End
    I tried in VALIDATE, CALCULATE, CHANGE events of END DATE, but nothing working!!
    PLs. let me kow how can i achieve my requirement? I am anewbie,
    Thank you

    http://forums.adobe.com/message/4264933#4264933

Maybe you are looking for

  • Two array objects compareTo:

    Have two arrays: ttt and ppp. I have to have a method to compare them. public int compareTo(object ob) both of the arrays are int type and both have super long numbers in them. Thanks

  • What are the best dimensions to allow for iPad 3 Retina for full-page landscape images?

    What are the best dimensions to allow for iPad 3 Retina for full-page landscape images? I read an article and cannot find it that said something about trying to make it 2million pixels and JPG to keep it small, but what exactly should the dimensions

  • IPod Touch (latest generation) internal sound malfunctioning/not working

    Defective sound on my new (received June 23, 2011) iPod touch 64GB.  The iPod Touch will play when an external speaker or earbuds are attached; however, the sound cannot be heard when the external speakers/earbuds are not attached.  When the iPod is

  • How do I get this report created???

    I have the following report I need to reproduce in SSRS: TMCRET11 XXXXXXXX COMPANY Date: 01/22/2015 Page 5 of 12 User Defined Basic Unit Report Time: 12:57:30PM Basic Unit ID: ARAM -0618801 Description: CMS USER DEFINED UNIT Type: User Defined Discip

  • Airlive USB WiFi - dhcpcd timed out

    Hi all, I'm trying to get working wireless connection with AirLive Turbo-g USB Wifi. I've installed wifi-radar and tried to connect to my AP. Firstly, output says Invalid argument to my WPA key and then it's trying to get an IP adress by dhcpcd which