Date validation

Hi ,
I have a created an textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE <> to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.

Hello,
You have duplicated this post, see my answer here -
Re: Date validation in "DD-MON-YYYY" Format,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

Similar Messages

  • The timesheet creation failed, because of problems with the project I server or with data validation

    Hi,
    One of my user is facing issue in creating new time sheet,
    "The time sheet creation failed, because of problems with the project server or with data validations".
    This issue is coming to only few members out of 10000 members.
    Note: For the same user, can able to do in other machines. only the problem in his machine. Have ran the office diagnostics, but still the problem persists.
    Is any add-on's/any settings need to update in IE. Could any one please help me on how to fix this issue?
    Many thanks in advance.

    I would check the compatibility settings in IE etc, or try another browser (chrome, safari etc.)
    Ben Howard [MVP] | web |
    blog | book

  • Excise Invoice Cancellation on Date validation only

    Hi Experts,
    i am having critical requirement from Business, which is not available in SAP Standard, So i need help from you guys...
    Excise invoice can be cancelled on the same day of system/posting date. but when the system date and posting dates are not matching it should through error..
    Example  : i created Excise invoice on 17th june,2011 this is posting date of excise invoice, if i try to cancell on 17th june , it should allow.
                        but when i try to cancell the excise invoice on 18th june (system date) , it should not allow to cancell and it say Error !!!
    i heard there will be possible through User Exit  OR Function Module OR Routins ... Please help me
    Thanks and Regards
    Madhu

    Dear Madhusudhanan,
    Following are the list of User Exits available for J1IIN
    J_1I7_USEREXIT_EXCISE_BEF_SAVE User exit after the excise header and details are written and they can changed in J1IS  , J1IIN and Automatic creation of Excise Invoice.
    J_1I7_USEREXIT_EXINV_ADDL_DATA User exit for Excise Invoice Additional Data    in J1IS and J1IG                 
    J_1I7_USEREXIT_J1I5_MATFORM    User exit for J1I5 material form changes                           
    J_1I7_USEREXIT_J1I5_VALIDATE   User exit for subsequent J1I5 data validation                      
    J_1I7_USEREXIT_J1IEX_BEF_SAVE User exit for J1IEX before the data is saved                    
    J_1I7_USEREXIT_J1IEX_CHANGE    User exit for changing data before display             
    J_1I7_USEREXIT_J1IS_BASE_VALUE User exit to Change base value in J1IS                
    I strongly believe that the first exit will serve the purpose.
    Now if you are cancelling it using J1IH, Check the following thread.
    J1IH-User Exit
    Thanks & Regards,
    Hegal K Charles

  • 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

  • Date validation in " DD-MON-YYYY"

    Hi ,
    I have created a textbox with date picker as (dd-mon-yyyy) .
    Now i want to create a validation on it for the format (dd-mon-yyyy) .
    I have created a pl/sql code with type "function returning error text".
    Begin
    If :P4_END_DATE IS NOT NULL THEN
    if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
    return 'END DATE should be in "DD-MON-YYYY" Format';
    end if;
    END IF;
    End;
    When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
    but when i change month like 20-11-2008 , it actually gives error
    ORA-01843: not a valid month
    Error ERR-1024 Unable to run "function body returning text" validation.
    Edited by: Vaibss on Nov 25, 2008 2:09 AM
    Edited by: Vaibss on Nov 25, 2008 2:10 AM

    Hello,
    Duplicate post -
    Date validation in "DD-MON-YYYY" Format,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

  • Issue with data Validation while migrating from one application to another

    Hi All,
    I am having a strange issue Kindly please help me .
    I have a data form which have data validation on each cell.The dataform is quite large and contain data for 4 accounts and year (Jan to Dec) combination .The issue is that I when I migrate this data form to other application which is just the replica of the main application. The validation on each cells changes its reference points.
    I have 5 more similar data form and I need to migrate then to other application and also on production sever. Is there any way that while exporting and importing them using formutil.cmd or other way that the validation cells reference does not change its reference point.
    For ex I have validation on Cell A5,A6..........AA6 after migrating it changes to A1,A1.........AA1.
    I am using 11.1.2.1.0 version of Hyperion Planning
    Kindly please help.
    Thanks in advance
    Vikash
    Edited by: user11391767 on Nov 30, 2011 10:47 AM

    Hi Mehmet,
    I tried using the FormDefUtil.cmd .But by using this the reference points of validation changes to first cell when imported.
    Thanks
    Vikash

  • List data validation failed when creating a new list item but does not fail when editing an existing item

    Dear SharePoint Experts,
    Please help.
    Why does my simple formula work in Excel but not-work in SharePoint?
    Why does this formula...
    =IF([Request Type]="Review",(IF(ISBLANK([Request Date]),FALSE,TRUE)),TRUE)
    ...work in Excel but fail when I try to use it in SharePoint?
    The intent of this formula is the following...
    If the field "Request Type" has the value "Review" and the field "Request Data" is blank then show FALSE, otherwise show TRUE.
    SharePoint saves the formula, but when a list item is saved where the formula is implemented, (under List Settings, List Validation), SharePoint does not, say anything other than that the formula failed.
    Note that the "list data validation failed" error only happens when I am creating a new item-- the formula above works just fine when one is trying to Save on the edit form. 
    Can you help?
    Thanks.
    -- Mark Kamoski

    Dear Jason,
    I appreciate your efforts.
    However, it seems to me that this statement of yours is not correct...
    "If it meet the validation formula, then you can new or edit the item, otherwise, it will throw the 'list data validation failed' error, it is by design".
    I believe this is NOT the answer for the following reasons.
    When I create a new item and click Save, the validation error is "list data validation failed".
    When I edit an existing item and click Save, the validation error is "my custom error message" and this is, I believe, the way it needs to work each time.
    I think, at the core, the error my formula does not handle some condition of null or blank or other default value.
    I tried a forumla that casts the date back to a string, and then checked the string for a default value, but that did not work.
    I tried looking up the Correlation ID in the ULS when "list data validation failed" occurs, but that gave no useful information because, even though logging was set to Verbose, the stack trace in the error log was truncated and did not given any
    good details.
    However, it seems to me that SharePoint 2013 is not well-suited for complex validation rules, because...
    SharePoint 2013 list-level validation (NOT column-level validation) allows only 1 input for all the multi-field validation formulas in a given list-- so, if I had more than 1 multi-field validation rule to implement on a given list, it would need to be packed
    into that single-line-of-code forumla style, like Excel does. That is not practice to write, debug, or maintain.
    SharePoint 2013 list-level validation only allows 1 block of text for all such multi-field validation rules. So that will not work because I would have something like "Validation failed for one or more of the following reasons-- withdrawal cannot exceed
    available balance, date-of-birth cannot be after date-of-death,... etc". That will not work for me.
    The real and awesome solution would simply be enhancing SP 2013 so that column-level validation forumlas are able to reference other columns.
    But, for now, my workaround solution is to use JavaScript and jQuery, hook the onclick handler on the Save button, and that works good. The only problem, is that the jQuery validation rules run before any of the column-level rules created  with OOTB
    SP 2013. So, in some cases, there is an extra click for the enduser.
    Thanks,
    Mark Kamoski
    -- Mark Kamoski

  • Data validation for Date Field in Web Dynpro ABAP

    Hi ,
    In my WDA i want to perform data validation for date filed. (i.e. While creating a new record i have to check the Start Date should be always lesser than End Date.)
    If u ll enter the wrong date it should validate the Date and throw an error message.
    Please Reply soon its urgent.
    Thanks,
    Deepika

    Hi,
    First read the two attributes start date and end date.
    Then write the following condition.
    IF item_start_date > item_end_date.
    Error message.
    Endif.
    For pop up error message you need to use Create_window method of the Interface if_wd_window.
    Thanks.

  • How to do a date validation with leap years

    I'm doing a date validation program in my Java class, and well it's pretty hard (for me that is). I have to be able to type in a date, have it say whether it's a leap year or not, and print out the number of days in the month. It seems pretty straight forward, but I get confused on trying to do the 'if else' statements and even the simplest things like getting the day prompting to work. >< The years I'm doing only goes through 1000 to 1999, so that's why those numbers are there. The program isn't complete, so if anyone could help show me what I'm doing wrong in the areas I'm working on then I'd appreciate it...and I'm still kind of in the basics of Java so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced so yea.
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    // Dates.java
    // Determine whether a 2nd-millenium date entered by the user
    // is valid
    import java.util.Scanner;
    public class Dates
    public static void main(String[] args)
    int month, day, year; //date read in from user
    int daysInMonth; //number of days in month read in
    boolean monthValid, yearValid, dayValid; //true if input from user is valid
    boolean leapYear; //true if user's year is a leap year
    Scanner scan = new Scanner(System.in);
    //Get integer month, day, and year from user
    System.out.print("Type in the month: " );
              month = scan.nextInt();
    System.out.print("Type in the day: " );
              day = scan.nextInt();
    System.out.print("Type in the year: " );
              year = scan.nextInt();
    //Check to see if month is valid
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;
    //Check to see if year is valid
    if (year >= 1000)
    year = year;
    else
    if (year <= 1999)
    year = year;
    else;
    //Determine whether it's a leap year
    //Determine number of days in month
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)
         System.out.println (Number of days in month is 31);
         else (year == 4 || 6 || 9 || 11)
         System.out.println (Number of days in month is 30);
    //User number of days in month to check to see if day is valid
    //Determine whether date is valid and print appropriate message
    }

    Here are some helpfull hints for you:
    1. Your code is really hard to read, there are two main reasons for this. First, your indentation sucks. Second, you seem to be fascinated with saving two (ok four if you count the shift key) keypresses to avoid using { and }.
    2. Not using the brackets (you know { and } which you like to avoid) also is causing your code to do some stuff you don't realize or want to happen, or at least it would be if your code compiled.
    3. If statements require arguements, "year == 1" is an arguement, "3" is not an arguement. Each operator like the or operator ("||") is essentially a new if and requires a complete arguement. So the following code peice:
    if (year == 1 || 3 || 5 || 7 || 8 || 10 || 12)Literally translates to if year equals 1 or if 3 or if 5 or if 7 or if 8 or if 10 or if 12. Doesn't make much sense in english, and it doesn't make much sense in Java either.
    4. I am pretty sure "year" is not the variable you want in the code snippet above (the one used in hint 3), especially considering years 1, 3, 5, 7, 8, 10, and 12 are not between 1000 and 1999. You need to be really carefull not make these kind of mistakes when coding, because they are by far the hardest to track down and fix later since they don't really throw up any flags or anything at compile or run time. Take your time and think thuroughly about each line of code while coding it, it will save you tons of time in the long run.
    5. What exactly do you expect statements like "month = month;" to do? That translates as make month equal to month. Do you go to the bank and say " I have exactly $3.56 in my pocket, so I would like to deposite all $3.56 and then withdraw $3.56 and put it back in my pocket"? How do you think the teller would look at you? Teller would probably do it, but the teller would feel like he/she wasted time with you and that you are not really right in the head. Java feels the same way when you make it do the same thing, and you love to do it.
    6. Code like the following is all wrong, and for more reasons than pointed out in hint 5.
    if (month >= 1)
    month = month;
    else
    if (month <= 12)
    month = month;
    else;Let's say someone put 13 in as the month. It passes the first check because 13 is greater than or equal to 1. so month which is 13, now gets set to 13 (gee that was effective). Now we hit the else and things get confusing because you didn't use brackets or proper indentation (hint 1) so we don't know what your real intent was. Did you mean else do nothing, and the next if statement is then executed, or did you mean to just run the next if statement if the else condition was met? Fortunatly it doesn't matter here because the next if statement is failed anyways since 13 is not less than or equal to 12.
    So, we leave this code with month ebing 13, wait when did we add a 13th month to the calendar? Are you using the Jewish calendar? Could be, except even if I put 1234567 as the month your code would except it as valid, and I know no calendar with that many months. Try writing this in english first and translating it to jave, like i would probably say "if the month is greater than or equal to 1 and less than or equal to 12 then the month is valid." Course now what do you do if it is invalid? Hmm, maybe I would actually say "while the month is less than 1 or greater than 12 ask the user for the month" until they get it right.
    There are a few other problems, but most of them are probably things you haven't learned yet, and they are not show stoppers so we will let them fly. You already have a lot of work to do to make this better. But I do have one more really really big usefull hint for you:
    Never, ever, under any circumstances, should you ever ask in any way or even hint at asking for someone else to provide code solutions to your problems. So "so if you do hint me with some code then I'd appreciate it if it was stuff that's not too advanced " was a very bad thing to do, but fortunatly for you you followed it with proof you were trying to write the code yourself. Had the code you provided not been so full of problems it was obvious a beginner wrote it, you would probably have gotten much less cordial responses. I would seriously consider avoiding any implication of wanting code, at least until you become a regular poster here and people know you are not just looking to get your homework done for you.
    Hope some of this helps.
    JSG

  • Losing Data Validation Messages when writing back to context

    ( The base for this question is the ALV grid in section 2 of this [TimeSheetMockUp|http://www.duke.edu/~michaelm/TimeCard/AnnotatedTimeSheet.jpg] )
    Users enter values in the white cells which represent the hours recorded on a given day for a certain type of time.  
    Lets say we have a z-object that supplies us with the overall grid structure, including the headers and (the shaded) summarization cells. The web dynpro ALV had been set to allow input only on the raw data cells. They are set to 4 places with one decimal.
    As the app was being developed, when we entered invalid data in a cell, such as 123456, or 1.2345 or u2018qu2019, a nice message was displayed that told the us about the issue.  This was free u2013 I guess the phase model does that for us, and we liked it.
    Well, down the road a pieceu2026 we needed to add a method to recalc all the summary values from the raw inputs. 
    METHOD wddoafteraction .
    * wizard: navigate to and get the rows data                         *
      DATA lo_nd_nd_rows TYPE REF TO if_wd_context_node.
      DATA lt_nd_rows TYPE wd_this->elements_nd_rows.
    * navigate from <CONTEXT> to <ND_ROWS> via lead selection
      lo_nd_nd_rows = wd_context->get_child_node( name = wd_this->wdctx_nd_rows ).
      lo_nd_nd_rows->get_static_attributes_table( IMPORTING table = lt_nd_rows ).
    * do the math                                                       *
      DATA lt_updated_rows TYPE wd_this->elements_nd_rows.
      CALL METHOD wd_assist->o_wc->recalc_update_and_return_wrows
        EXPORTING
          im_rows = lt_nd_rows
        IMPORTING
          ex_rows = lt_updated_rows.
    * repopulate the rows                                      *
      lo_nd_nd_rows->bind_table( new_items = lt_updated_rows set_initial_elements = abap_true ).
    Now, weu2019re losing all the nice data validation messages u2013 they do not display (the offending entries are just cleared) !!!
    After some investigation, it seems that the bind_table call is where they get lost (without that call, they appear) .
    Iu2019ve tried placing this code in a number of hook methods, but the same thing occurs.  It is currently in the viewu2019s afteraction hook.
    So, u2026 I have two questions.
    u2022     How do I get my nice messages back. ?
    u2022      Where is the right place to update my context from 
    ( Btw, downstream, our recalc outines will also want to throw messages that we will want processed after we get through the initial validation  )
    Thanksu2026
    u2026Mike

    Fixed with SAP Note 1410122 - WD ABAP ALV: Messages are not displayed

  • How to setup data validation mechanism

    Hi, gurus,
    Now our customer wants to do data cleansing before loading data into infocube or ods, the source system includes R/3, flat file, and some legacy systems. However the client wants to create a staging area to keep incoming data, and develop some programming to check data validation. The specific requirement is as following:
    1. Provider a user interface to let biz man to correct the error record;
    2. can code logic to check the data rejection reason, such as field type is wrong, master data doesn't exist, and etc, and can prompt these reason message to assist business guy correct;
    They want to create a specific staging for data cleansing purpose, and because refer to my prior experience with some ETL tools, we can ask developer to write embeded program in informatica or datastage to check data quality and write down the rejection reason in a file to assist business man correct;
    so if we want to use SAP BW PSA for this purpose, is it feasible? Can we modify PSA to add one column, 'rejection reason' and add some ABAP program here; or you guys have some other good options for this function.
    and can we use PSA to keep all data for 5 years? because the annual delta data is not very big, just 4G.
    Someone suggests to create Z table in BW system for staging purpose, however this solution can not use BW ETL tool to load data but need heavy ABAP programming, so any good solution on this?
    BTW: can I modify PSA structure to add 1 or 2 column, such as reject reason?
    and how to use abap program to access Characteristics master data? are there any function module to read master data directly rather than select data from P table or T table?
    Regards, ls

    I think if the business guy is given some basic BW training and some aspects about correcting PSA records or adding or loading missing master data,then it can work.
    The BW monitor does give you good enough messages about the data load errors.
    I do not think it is good to modify the PSA..because this is against purpose of having PSA.PSA has records in transfer structure format,as sent by source system.
    PSA is often preserved for data reloads that might be needed some point in future.
    As u r saying that annual record load is not big,u can preserve PSA and then later develop a custom program to delete PSA's older than..say 2-3 years..(there might a std program for this).
    Modifying or adding columns to PSA is not general practice.
    For reading master data maybe u can use this fn module..RSAU_READ_MASTER_DATA.

  • Date Validation problem in form with report

    Hi,
    I am stuck on this date validation issue in a form with report that I am working on-
    I have an Active_date_start and an Active_date_end field. I want to validate the form in such a way that if the user enters the Active_date_end < active_date_start then it should error out appropriately asking to change the active_end_date . Also another problem is that the changes are made to the active_date_end they should reflect in the table. How do I accomplish this.
    Appreciate all the help offered.
    Thanks.

    Hi,
    Thanks for the code.Now the APPLY CHANGES works fine except that it throws an error when I change the end date to a date which is less than the start date . So it does show me my error and does not go further but also shows me the error -
    Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306: wrong number
    or types of arguments in call to 'NVL' ORA-06550: line 1, column 7: PL/SQL: Statement
    ignored Invalid PL/SQL expression condition: ORA-06550: line 1, column 29: PLS-00306:
    wrong number or types of arguments in call to 'NVL' ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I looked up the error number and it says its a generic error type where the error can be found on the line number specified. But in this case how and where do I look for the error line?. This is the code I am using-
    DECLARE
    vACTIVE_DATE_START DATE;
    vACTIVE_DATE_END DATE;
    BEGIN
    vACTIVE_DATE_START := TO_DATE(:P4_ACTIVE_DATE_START, 'DD/MM/YYYY');
    vACTIVE_DATE_END := TO_DATE(:P4_ACTIVE_DATE_END, 'DD/MM/YYYY');
    IF vACTIVE_DATE_END < vACTIVE_DATE_START THEN
    RETURN 'End date is before start date';
    ELSE
    RETURN NULL;
    END IF;
    END;
    My base table has the active_date_start as NOT NULL. Now I have the exact same code for APPLY CHANGES
    in other form and it works fine not giving the above error. I am at a loss to know how I can get rid of the error.
    Any suggestions!.
    Thanks in advance,
    A

  • 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;
        }

  • Request Data Validator is not working

    Hi Guys,
    I am trying to invoke a plugin while submitting a request through CATALOG in OIM 11gR2. The user case i am trying to achieve is - (1) User/Admin login to OIM and go to CATALOG option (2) Select an Application instance, fill the values in the form and checkout (3) While submitting this validator should invoke which will validate the request data and throw exception if any.
    For this i was thinking to utilize the plugin for oracle.iam.request.plugins.RequestDataValidator "This is used for custom validation of request data after submission"
    My plugin.xml looks like
    <?xml version="1.0" encoding="UTF-8"?>
    <oimplugins>
    <plugins pluginpoint="oracle.iam.request.plugins.RequestDataValidator">
    <plugin pluginclass="com.test.oim.TestRequestValidator" version="1.0" name="TestReqValidator">
    </plugin>
    </plugins>
    </oimplugins>
    And i am using simple code as below
    package com.test.oim;
    import oracle.iam.request.exception.InvalidRequestDataException;
    import oracle.iam.request.plugins.RequestDataValidator;
    import oracle.iam.request.vo.RequestData;
    +public class TestRequestValidator implements RequestDataValidator {+
    +public TestRequestValidator() {+
    super();
    +}+
    +public void validate (RequestData reqDta) throws InvalidRequestDataException{+
    System.out.println("************************************************");
    System.out.println("***Justification***" reqDta.getJustification());+
    throw new InvalidRequestDataException(new Exception("Invalid User"));
    +}+
    +}+
    My plugin directory contains the plugin.xml file and the jar file (with above class) under lib directory. I placed the zip file under OIM_HOME/Plugin directory and even restarted the servers.
    However this code is not invoking and i can successfully create the request (i tried from user and admin both). Please advise if anyone has any idea. Thanks

    Hi Duncan,
    I have mapped the DataSet validator element in my plugin.xml file
    +<?xml version="1.0" encoding="UTF-8"?>+
    +<oimplugins>+
    +<plugins pluginpoint="oracle.iam.request.plugins.RequestDataValidator">+
    +<plugin pluginclass="com.test.oim.OIMREQValidate" version="1.2" name="OIMREQValidate">+
    +<metadata name="Data Validator">+
    +<value>AssignRolesDataSet|ModifyUserDataset</value>+
    +</metadata>+
    +</plugin>+
    +</plugins>+
    +</oimplugins>+
    Still my request data validator is not getting invoked. I can successfully create the request. (Per this validator every request should fail and logs should getting logged). My validate method code is below
    +public void validate (RequestData reqDta) throws InvalidRequestDataException{+
    RequestLogger.LOGGER.logp(Level.WARNING, "OIMREQValidate", "validate", "CALLING THE CUSTOM PLUGIN");
    System.out.println("***Justification***" reqDta.getJustification());+
    throw new InvalidRequestDataException(new Exception("Invalid User"));
    +}+

  • Date Validation - a Nightmare for ME!

    Hi, I searched the forum and came up with some code that works for me partially. I am still having problems with getting the end result that is needed.
    I need to do a date validation where the begin date is less than end date. Below is the syntax..It works but when I put in the correct end date i still get the error message athough the date is correct. Also if I set the focus back to the field and correct the date it still set focus back... I'm sure it is something simple that I am missing
    ----- form1.subformpage1.empnsubform.DateTimeField2::exit - (JavaScript, client) -------------------
    if (DateTimeField2.formattedValue>=DateTimeField1.formattedValue);
    xfa.host.messageBox("Incorrect Date range");
    What am I missing? Yes I still struggle with writing scripts!!!!
    thanks

    I have a similar thing on one of my forms, the fields are "Date Submitted" and "Date Needed" and I need to validate that the Date Submitted date occurs before the Date Needed date.  If it does not, it prompts a response dialog box and asks for a new DateNeed to be entered.  Here is the code I used: (I'm by no means an expert at code)<br /><br />//This just sets the values of the date/time fields to variables, and then checks for a null value.  If null, it changes the rawValue to an empty string for inserting into database.  If not null, it leaves the existing rawValue unchanged. Unless you're writing info to a database, you probably wouldn't need this.<br /> <br />var DateSubmit = form1.MainForm.Info.DateSubmitted.rawValue == null ? "" : form1.MainForm.Info.DateSubmitted.rawValue;<br />var DateNeed = form1.MainForm.Info.DateNeeded.rawValue == null ? "" : form1.MainForm.Info.DateNeeded.rawValue;<br /><br />if (DateNeed<DateSubmit)<br /><br />{<br /><br />     var dateResponse = xfa.host.response("The Date Needed date must be later than the Date Submitted date.\nPlease enter new date below: (MM/DD/YYYY format)", "Date Needed Error");<br /><br />     var myDate = new Date(dateResponse);<br /><br />     var myFormattedDate = util.printd("dd mmm yyyy", myDate);<br /><br />     form1.MainForm.Info.DateNeeded.formattedValue = myFormattedDate;<br /><br />}<br /><br />BTW, I have this as code on a submit button that does all of my validations and then writes a new record to a database.  But I think you could also do this on the exit event of the second date/time field if needed. The variable declarations at the top would be slightly different.<br /><br />Lynne

Maybe you are looking for

  • Linux users cannot open Firefox on multiple systems that are mounting the same network drive as their home directory

    I am supporting a user who is logging into multiple linux systems that all have the same /home directory mounted to a network filer. When the user opens firefox on one system, he is unable to open firefox on other systems. I'm assuming this is becaus

  • Itunes wont connect to store!

    Hey, Iv recently downloaded itunes for the 1st time as my partners just upgraded to an iphone4. I seem to be having trouble connecting to the itunes store Iv tried everything thats been suggested and what iv read on google but nothing seems to be wor

  • Need to send the report output in email body.

    Hi Friends, I need to send the report output in body of the email but not as an attachment. Requesting your suggestions. Please elaborated answers are expected. Thanks & Regards, S.Suresh Babu.

  • Can I 'lock' application icons, and if so, how?

    The students in my classroom have recently figured out how to change an application's icon, and it's getting out of hand. Is there a way to make it so an administrator username and password must be entered to change said icons? It's getting a bit out

  • Purchased apps didn't get updates and not appear in the cloud

    Hello, Some apps did not added to my Purchased Apps. Most of this are free apps like Facebook, Flipboard, Popular Science, Wired, Imdb etc... So when this apps get an update in the store, symbol appears next to the Application tab on iTunes, mark tha