Results 1 to 6 of 6

Thread: Check for duplicates in the grid of Headerless detail form

  1. #1
    New Member Joshua Tomlin's Avatar
    Join Date
    Mar 2005
    Location
    NJ, USA
    Posts
    10

    Check for duplicates in the grid of Headerless detail form

    I have a headerless detail form where users copy records into the grid from a spread sheet or manually enters into the grid. There is a situation where the user could type in the same value twice or could appear twice in the grid while copying records from the spreadsheet. Is there a way to check for duplicates when the user is entering records in the grid or copying records into the grid and set an error as they are entering records instead of waiting for them to hit the OK button. I want to do a validation where when the user enters a record in the grid, it needs to check the previously entered records in the grid to ensure that the same value is not already entered.
    Please let me know how I can achieve this.

    Thanks,
    Joshua
    E1 9.1
    Env : E1 8.12, SQL Server, Windows

  2. #2
    Senior Member peterbruce's Avatar
    Join Date
    Jan 2004
    Location
    NSW Australia
    Posts
    2,108
    Joshua,

    You can put code into the Grid Event Rules using either the "Row Exited & Changed Inline" or the "Row Exited & Changed Asynch" events.
    Thanks, Peter

    "Give a person a fish, feed them for a day, teach them how to fish, feed them for a lifetime."

    E9.1 TR9.1.2.1, Enterprise Server: Sun, Database Server: Sun, Oracle DB: 11g, Weblogic.
    Create!form 7

  3. #3
    New Member Joshua Tomlin's Avatar
    Join Date
    Mar 2005
    Location
    NJ, USA
    Posts
    10
    I do not have a lot of experience on Interactive applications.
    I have been trying to do this in the "Row Exited & Changed Asynch" event. I cant get it to work though - It loops and finds itself. I guess I am not using the right system functions.
    Could any of you please help me with what code I should be writing to achieve this.

    Thanks,
    Joshua

  4. #4
    Senior Member peterbruce's Avatar
    Join Date
    Jan 2004
    Location
    NSW Australia
    Posts
    2,108
    Joshua,

    Can you post your code?
    Thanks, Peter

    "Give a person a fish, feed them for a day, teach them how to fish, feed them for a lifetime."

    E9.1 TR9.1.2.1, Enterprise Server: Sun, Database Server: Sun, Oracle DB: 11g, Weblogic.
    Create!form 7

  5. #5
    New Member Joshua Tomlin's Avatar
    Join Date
    Mar 2005
    Location
    NJ, USA
    Posts
    10
    Hi Peter,

    Thanks for your response. I now got it to show the error if there is a duplicate.
    But now when I go and delete the duplicate line the error does not go away on the other line.
    Below is my code

    //
    VA evt_szIdentifier2ndItem_LITM = GC ISBN-13
    Get Selected Grid Row Number(FC Grid, VA frm_mnCurrentGridRow_MATH01)
    Get Max Grid Rows(FC Grid, VA frm_mnMaxGridRows_MATH01)
    VA frm_mnRowCount_MATH01 = "1"
    While VA frm_mnRowCount_MATH01 is less than or equal to VA frm_mnMaxGridRows_MATH01 And VA frm_mnRowCount_MATH01 is not equal to VA frm_mnCurrentGridRow_MATH01
    Get Grid Row(FC Grid, VA frm_mnRowCount_MATH01)
    If VA evt_szIdentifier2ndItem_LITM is equal to GC ISBN-13
    Set Grid Cell Error(FC Grid, <Currently Selected Row>, <All Columns>, "I75E038")
    Set Grid Cell Error(FC Grid, VA frm_mnCurrentGridRow_MATH01, <All Columns>, "I75E038")
    Else
    Clear Grid Cell Error(FC Grid, <Currently Selected Row>, <All Columns>)
    ! Clear Grid Cell Error(FC Grid, VA frm_mnCurrentGridRow_MATH01, <All Columns>)
    End If
    VA frm_mnRowCount_MATH01 = [VA frm_mnRowCount_MATH01]+1
    End While
    //

    Any help would be greatly appreciated.

    Thanks,
    Joshua

  6. #6
    Senior Member peterbruce's Avatar
    Join Date
    Jan 2004
    Location
    NSW Australia
    Posts
    2,108
    Joshua,

    The code looks good to catch the duplicate and set the error. However when the duplicate row is deleted, the code is not run, because the row has not been changed. Thus the error is not cleared.

    You will need to add code to remove the error in a different event, probably Delete Grid Rec Verify-Before.
    Thanks, Peter

    "Give a person a fish, feed them for a day, teach them how to fish, feed them for a lifetime."

    E9.1 TR9.1.2.1, Enterprise Server: Sun, Database Server: Sun, Oracle DB: 11g, Weblogic.
    Create!form 7

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company, Oracle or Peoplesoft.