How to do validation on multi record block at run time...

Dear Friends,
I have to do validation at run time on multi record block.
If user tries to enter and save two or more records in same multi record block with same data at run time, it should not allow it and display a message like, " error : Records are having same(duplicate) values. "
I already did validation with the data coming from database table using cursor. But confused about how to do at run time(on one screen only) ??
Please, give details about how to check duplicate records on form block before saving it to the table ????
Regarding details would be greatly helpful.
thanks,

Hi...Pankaj
thanx for your reply..
I already did validation for the data coming from table....
but I need to do it on form only...at run time...
exa...
In one multi record block
record no : column 1 : column 2 : column 3
1 abc 123 hi
2 abc 123 hi
so it should check on the form itself, here I m not getting data from table...I am just
navigating from first record to second using down arrow.
so, may be 2 possibilities.
1) when user navigates using tab to third record, it should say like two duplicate records.(may be like when validate record or item)
2) or when user tries to save, it should say two duplicate records.
so, everyting should take place on form screen only.....
waiting for your reply,
thanx...

Similar Messages

  • How to do it in multi-record block

    Hi all,
    i have 1 text items in a multi-record block number of record displayed 10
    and i have values like 100 , 50, 30 in first 3 records and in 5th record i want to put some value like
    20 then i want to calculate all values like 100 + 50 + 30 +20 = 200 and i want to put the total value in a single record block.
    but my problem is i cannot able to calculate all the value because for the totale value i have to
    write a for loop to loop through the record
    but go_block() is not working in post_change .
    if any solution is there plz suggest.......

    Hi zeeshan
    my problem is i cannot able to calculate all the value because for the total value
    put the total value in a single record block.
    First pls the following...
    Guidelines for Working with Calculated Items Calculated items_
    1- They are display-only control items.
    2-Calculated items cannot be database items.
    3.While you can set a calculated item's Enabled, Mouse Navigate, and Keyboard Navigable properties to Yes,
    you cannot set the Insert Allowed or Update Allowed properties to Yes
    Second Keyword: TOTAL is a reserved oracle key word... pls read the Details...
    go_block() is not working in post_change .well u can use timers but no need for it u can reference block item but first u have to accumulate the values per record in WHEN-VALIDATE-ITEM TRIGGER in the last calculated item which is inserted by the user and assign it to the display item in ur current multi-record block :*block_name.total_item*.. as follow...
    :block_name.total_item := :item1 + .... ; Then u create a second display item > no of records property = 1 , named e.g. final_summarized_totals
    In order to summarize this total values accumulated in the multi-record display item named e.g. block_name.total_item
    Finally using PRE-INSERT , PRE-UPDATE,PRE-DELETE Triggers to assign the value calculated into the display item * block_name.total_item* into the db_item into the previously mentioned Trigger Block-Level Off-course.
    :block_name.total_db_tem := :i:block_name.final_summarized_totals ; Hope this helps...
    Regards,
    Amatu Allah

  • How to set the number of records displayed at run time

    Is it possible to set the number of records displayed block property at run time? The built-in 'GET_BLOCK_PROPERTY' can retrieve the number of RECORDS_DISPLAYED. But I can't find SET_BLOCK_PROPERTY to set this property. Is there anyway I can set this property programmatically? Thanks for any suggestions!

    Bookmark Go to End
    goal: How to vary the number of records displayed in a block
    programmatically
    fact: Oracle Forms Developer
    fix:
    Block property 'Number of Records Displayed' can not be changed during runtime
    using SET_BLOCK_PROPERTY. However, it is still possible programmatically change
    the visual appearance of the form so that it creates effect of changing this
    property. To achieve such an effect follow these steps:
    1. in Forms Builder, in the multirecord block define the new set of items.
    The simplest way is to copy/paste the original item and rename created item.
    2. set properties of these new items so that they are the same as the properties
    of the original items. If these new items were copied from original items
    then properties are already the same. Modify following properties
    'Database item' on new items to value 'No'
    'Synchronize with item' to the value of the original item
    'Number of Items Displayed' to desired value.
    'Visible' to 'No'
    In other words, these new items are mirrors of original items.
    3. code event, which is meant to trigger the change in block appearance.
    This code should use SET_ITEM_PROPERTY built-in to set properties
    like 'VISIBLE', 'ENABLED', 'NAVIGABLE', 'UPDATE_ALLOWED' and others
    to desired value for items which are about to be displayed, then
    move cursor to one of these just displayed items with GO_ITEM built-in
    and then hide the previously displayed items.
    Example:
    Assume that the block is built on SCOTT.DEPT schema. Following will
    change the set of displayed items
    set_item_property('dept.mdeptno',visible,property_true);
    set_item_property('dept.mdname',visible,property_true);
    set_item_property('dept.mloc',visible,property_true);
    set_item_property('dept.mdeptno',enabled,property_true);
    set_item_property('dept.mdname',enabled,property_true);
    set_item_property('dept.mloc',enabled,property_true);
    set_item_property('dept.mdeptno',update_allowed,property_true);
    set_item_property('dept.mdname',update_allowed,property_true);
    set_item_property('dept.mloc',update_allowed,property_true);
    set_item_property('dept.mdeptno',navigable,property_true);
    set_item_property('dept.mdname',navigable,property_true);
    set_item_property('dept.mloc',navigable,property_true);
    go_item('dept.mdeptno');
    set_item_property('dept.deptno',visible,property_false);
    set_item_property('dept.dname',visible,property_false);
    set_item_property('dept.loc',visible,property_false);
    Regards,
    Monica

  • How can I create a loop in a multi-record block (on the background)

    I have a multi-record block.
    In one item I change a value.
    Upon this change, in the when-validate-item I would like to
    change other records in the same block.
    I planned to loop the block with go_record and to do my things
    in each record. Unfortunately the go_record built-in is
    restricted and cannot be used in a wvi-trigger.
    Another approach can be to update the records in the database
    and to perform an execute_query after this change. Also this
    procedure cannot be used in a wvi.
    How can I easily loop in a multi-record block???

    You can try to put loop with go_record in KEY-NEXT-ITEM on that
    field.
    Or if you change something and then press KEY-COMMIT you can
    update another records in database and after commit do again
    execute_query. Something like :
    on KEY-COMMIT:
    update_another_records;
    commit_form;
    execute_query;

  • Enabling the current record only in a multi record block..how?

    Hi,
    I'am trying to enable a single record in a multi record block.
    If i use SET_ITEM_PROPERTY it enables all records, SET_ITEM_INSTANCE PROPERTY does not have ENABLED Property.., so how to go about this?
    I have a check box beside each record, if i check the check box only that record should get enabled..is there any way?
    Regards
    Mahesh

    I found out the answer :
    technical note 661 on on Siebel Supportweb (metalink3) :
    "how to embed OBI requests in Siebel Business Application views, so that navigating among the records in the parent applet updates the child Analytics applet with context-appropriate content"

  • How to get the original record Number in Multi-Record Block

    Hello Everyone,
    I know how to find the duplicate item in the multi-Record block,
    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA Here 3rd record Item_name is duplicated, I can able to check and display the message that 'Item is duplicated' ,I found from [sheikyerbouti.developpez.com/duplicates/duplicates.htm] .
    but I want to show along with original line number i.e 1 when the item_name is entered .
    Here I want to check the original Line_Num and want to display the message
    'Item is duplicated,Update quantity in Original Line 1'
    Can anyone help me to get this?
    Thank You.
    Regards,
    Guru.

    Hi Francois,
    Actually I want to check and show the message when the item_name is entered i.e WHEN-VALIDATE-ITEM TRIGGER.
    I put the following code in WHEN-VALIDATE-ITEM TRIGGER
    Declare
         curnum number;
         dupnum number;
         cur_item varchar2(100);
         v_alert_no number;
         p_linerec varchar2(100);
    Begin
    curnum := TO_NUMBER(:System.Trigger_Record);
    cur_item := :Lines.Item_number;
    First_Record;
    p_linerec := :Lines.Item_number;
    LOOP
    If p_linerec = cur_item then
         dupnum := :Lines.Line_num;
         set_alert_property('ALERT_STOP',ALERT_MESSAGE_TEXT,
    'Duplicate Item Found,Update QTY in Original line number '||dupnum);
       V_ALERT_NO := show_alert('ALERT_STOP');
       :LINES.ITEM_NUMBER := NULL;
    :LINES.ITEM_DESCRIPTION:= NULL;
    :LINES.ITEM_REVISION:= NULL;
    :LINES.ITEM_CATEGORY:= NULL;
    elsIF (:System.Last_Record = 'TRUE') THEN
         Go_Record(curnum);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP;
    End; But I am getting the following error,
    FRM-40737:Illegal Restricted Procedure
    FIRST_RECORD in WHEN-VALIDATE-TRIGGERand then
    its showing for first line itself.
    Duplicate Item found.Update QTY in Original line number 1so I put the condition
    If :Lines.Line_num > 1 then --Only to check when the block having more than one record.but now it checking from second record and displaying,
    Duplicate Item found.Update QTY in Original line number 2 --(instead of Update QTY in Original line number 1)Can you tell me how can I change the above code for my requirement?
    Thank you.
    Edited by: Gurujothi on 27 Mar, 2013 5:20 PM

  • How to make the column in multi-record block resizable?

    I am using Form6o, can I make the column in a multi-record block resizable?
    Thanks!

    I don't know exactly how they did it, but I have seen it done in Forms 6i. It is not exactly Excel style, but it comes close. You can use when-mouse-down and when-mouse-up triggers to determine start and end position of the mouse (with system.mouse_x_pos) and then set the width property.
    So, when you drag the mouse, you don't see the column size increase, you only see the result after you let go of the mouse button.

  • How to call a report with a bind variable from a multi-record block

    Hi,
    I have created a report using the BI Publisher functionality. I did all the integration, created the SQL Query and uploaded the template. Up till here everythings fine!
    My SQL Query has 2 bind variables.
    I will call my report from a multi record block, at the end of each record an icon is shown which the user can click to open the report.
    I created a column link for this item (PRINT_REPORT=Inschrijvingsformulier) but I do not manage to pass the parameters to my report. The parameters I want to pass are 2 columns in this Multi Record block.
    I created 2 hidden fields on the page P9_PARAMETER1, P9_PARAMETER2 with the same names as my bind variables and fill this in with the values #PARAMETER1#, #PARAMETER2# from the multi record block.
    It seems it does not work as my report stays empty. (also XML file stays empty).
    Am I trying the wrong way?
    Thanks for any advice,
    Kris

    hi khadeer,
         create one report program and write the required code,and call this function module 'SSF_FUNCTION_MODULE_NAME' and give your smartform name  and also when u activate ur smart form u will get one function module call that function module also and specify any tables used...
    i think this solves ur problem...
    any queries revert back..
    pls reward points if helpful,
    shylaja

  • How to convert a puch button disabled in a multi record block?

    Hi!
    I have a multi-record block and I need to set some specific item to disabled.
    I tried using set_item_instance_property with the following sentence:
    set_item_instance_property('INAF_ESC.EEAS_TIPO' ,CURRENT_RECORD, ENABLED , PROPERTY_FALSE);
    but it didn´t work.
    Anyone have any idea?
    Thanks
    Vero

    Hi,
    ENABLED is not supported SET_ITEM_INSTANCE_PROPERTY built-in.
    If you are env. has no mouse enabled, you can disable NAVIGABLE property using above builtin.
    There is a way make the end-user to feel like it is disabled.
    Create a visual attribute DISABLE_VA, with colors simillar to disabled buttion and set thie DISABLE_VA when the conditon is failed.
    Inside the button-pressed trigger check whether the conditon is true or false. If the conditon is failed you simply do nothing.
    ~Gouri Sankar
    But we can not stop the click action,

  • How to set default settings to display record count in multi record block

    Hi All
    Whenever I query my multi record block, I get 1/? as record count at the console in standard Oracle Applications. Is there any setting so that it displays 1/50 (in case total record queried is 50). I don't want to set query all property of block as I don't have any control in standard Apps forms.
    Thanks in advance
    Navdeep

    Check out the next_navigation_item option for the get_item_property procedure. If you use this you can do the process without having to navigate from one item to the next.
    You can do something like this (untested) to move and resize the items (other than the first in the block):
    PROCEDURE move_and_resize(p_item IN ITEM, p_width IN PLS_INTEGER) IS
      prev_item ITEM := Get_Item_Property(p_item, PREVIOUS_NAVIGATION_ITEM);
    BEGIN
      Set_Item_Property(p_item, WIDTH, Get_Item_Property(p_item, WIDTH) + p_width);
      Set_Item_Property(p_item, X_POS, Get_Item_Property(prev_item, WIDTH) +
                                       Get_Item_Property(prev_item, X_POS));
    END move_and_resize;
    move_and_resize(myitem, -30);

  • Disabling a button in a multi record block

    Hi everyone,
    I have a multi record block with a button on each record, I have to be able to disable a button at runtime (following some conditions).
    the SET_ITEM_INSTANCE_PROPERTY (item, record, enabled, property_false) does not work !
    Any idea on how can I do it ?
    Thanks for any help.

    I don't think "enabled" is a valid property for SET_ITEM_INSTANCE_PROPERTY. You were probably thinking of SET_ITEM_PROPERTY but this won't work for you at the record level.
    The only thing I can think of right off hand is to set the visual attribute using SET_ITEM_INSTANCE_PROPERTY to make each button look enabled or disabled. You could define 2 visual attributes, say something like VA_BUTTON_ENABLE and VA_BUTTON_DISABLE.
    If you want the button to look enabled then:
    SET_ITEM_INSTANCE_PROPERTY(item, record, visual_attribute, 'VA_BUTTON_ENABLED'');
    If you want the button to look disabled then:
    SET_ITEM_INSTANCE_PROPERTY(item, record, visual_attribute, 'VA_BUTTON_DISABLED');
    Then, in your WHEN-BUTTON-PRESSED trigger, look at the visual attribute for that record using the GET_ITEM_INSTANCE_PROPERTY, and if the visual attribute is VA_BUTTON_ENABLED then execute your button code otherwise don't do anything.
    Give it a try and see if that works for you.
    Hope it helps.
    Travis

  • Editing record items in a multi-record block - 1 record at a time.

    Hello,
    I have the following scenario: Currently in my multi-record block, to edit an item of a record, the user has to double click on the record to enable the 'save changes' button. However, I want to turn the navigation to all other records turned off. The only way the user should be able to edit other records is save changes first, then again double click on the desired record to re-enable the 'save changes' button (at this time navigation to all other records should be turned off). ie., the user should be able to edit 1 record at a time (At any given time, I won't be having many records in the block which the user may have to modify).
    How can this be achieved?
    Thanks,
    Chiru

    That is pretty odd requirement, but this might work:
    When the user double-clicks the record, enable the Save button, and set a value in any column of the record to its current value. This will cause Forms to set the record status to CHANGED, and will not permit navigation away from the record until the When-validate-record trigger runs successfully.
    In the Save button, start a non-repeating timer to run maybe 20 milliseconds, then issue a Validate(Record_Scope); command. Check form_success then commit_form.
    In the when-validate-record trigger: Do any record validation that may be necessary, and Raise Form_Trigger_Failure if anything is wrong. Then check for the existence of your Save button's timer. If it does NOT exist, issue a message like: "You must Save the changes first" and Raise Form_Trigger_Failure; If the timer exists, do not raise the error.

  • Validate a Multi Record Block.

    Hello every body-
    Would appreciate your inputs as to how to go about doing this.
    I have a multi record block like below.
    SEQ # THEMES PICK
    1 THEME 1
    2 THEME 2
    3 THEME 3
    4 THEME 4
    5 THEME 5
    6 THEME 6
    The 'PICK' field is a check box, that the user will click on if he needs to select a particular 'THEME'.
    I need to do the following validations ( I will be having a button something like INSERT BUTTON) at the bottom of the multi column block.
    .. Only 3 THEMES are to selected.
    .. If more than 3 THEMES are selected, need to show an alert stating that only 3 THEMES can be selected, allow the user to change selections.
    .. If only 3 THEMES are selected, need to insert the selected THEMES into a table.
    For example, in the above sitation, if the user picks 'THEMES' with SEQ# 2,4,5; then I need to insert the SEQ #, along with the other primary key (which is STUDENT ID) into the table.
    Would really appreciate if any one could let me know how to do this.
    Thanks for your time..

    1) Make a hidden summarized number field called mycounter in the same block. Set the summarized function to sum, block to 'myblock', field to 'mycheckbox', calculation mode to "summary"
    2) Make the checked and unchecked values of the check box 1 = checked and 0 = unchecked. Set the datatype of the checkbox to a number.
    3) In the when-checkbox-changed of the checkbox put this code..
    if :my.mycounter >= 4 then
      message('Error:  May only check 3 or less.');
      :myblock.mycheckbox := 0;
    end if;With this code they wont be able to check more than three rows. This is one piece of your puzzle anyway.
    Message was edited by:
    Mark Reichman

  • Get next value in a Multi Record Block

    Hi,
    I've a Multi Record block with 2 items like below.
    pos width
    1 7
    8 5
    13 5
    18 2
    ie pos in next item is sum of pos and width of previous item.I've already implemented this.
    The problem is if the user changes width in a particular record,I want to change next records pos automatically.
    To achieve this,I wrote a when-new-record -instance-trigger as follws:
    if :system.cursor_record=1 then
    :pos:=1;
    elsif :system.record_status='changed' then
    :pos:=:pos+:width;
    end if;
    but even Though I change column width of block,:system.record_status still remain 'INSERT'.
    Pls can u pls tell me how can I acheive this?
    Prashanth Deshmukh

    You cannot use Record Status like that.
    You need to create a procedure that loops through your entire block, keeping track of the pos and width of the prior record to calculate the new pos of each record.
    Your procedure would need to do something like this:
    Declare
        v_Pos  pls_integer := 1;
    Begin
      Go_block('B1');
      First_Record;
      Loop
        Exit when :System.record_status='NEW';
        :B1.pos := v_Pos;
        v_Pos := v_Pos + :B1.width;
        Exit when :System.last_record = 'TRUE';
        Next_Record;
      End Loop;
      First_Record;
    End;

  • Setting background color in multi record block

    Hi all!
    I've a table with around 150 records of colors with html-color-names and rgb codes.
    I would like to have a sample item in my form 9.0.4 to display the color as a preview for
    each record in a multi-record block when querying the table.
    I would not like to create a visual attribute for each color. So display_item() is no choice.
    (except: somebody show me how to create va's with the japi)
    Somebody knows a way to accomplish this?
    Thanks in advance and regards
    Stauder

    Here's a solution which should work :
    1. Use a mirror item for the numeric item which has to
    be displayed
    using the format mask based on value in column1
    The data type of the mirror item : Char
    X and Y co-ordinates : Same as the item
    on which it is
    mirrored
    Size and Height : Same as the item
    on which it is
    mirrored
    2. On normal display, Mirror item is displayed
    3. When Mouse-Click or Pre-Text Item trigger on the
    Mirror Item :
    - Use the Go_Item ('Actual Numeric Item');
    This will bring up the Numeric Item and the Mirror
    item goes in hiding
    - A VWI trigger on Numeric Item should Then be :
    If ( :col1 = 'A' ) Then
    :Mirror_Item :=
    To_char(:NumericItem, ',999,999.99');
    Else
    :Mirror_Item :=
    To_char(:NumericItem, '99999999');
    End If;
    4. A key-Next-Item (On Numeric Item) or other trigger ??
    should then
    use Go_Item (:Mirror Item) to bring forward the
    formatted numeric item
    -- Shailender Mehta --

Maybe you are looking for

  • Delivery Split for PO

    I want to split delivery creation for 'NL' type of delivery for STPO i.e. 'UB' type. i.e. if a PO has 2 materials with different material types ( e.g FERT & HAWA ), then 2 different deliveries have to be created in this case automatically. How can th

  • Need help to automate a process

    Hello friends,     We have customized the program RPRCCC00 for credit card clearing. WE run this program for diff. countries. It reads the credit card expense file from application server. We daily receive the file names in mail. After this we run PR

  • Credit Memo is not generating

    Hi In my client site all the billing are order related and  in copying control for billing type -ZCG2(Credit memo) to ZCF2(invoice) is maintained and all the settings are O.K. Now when i create a Credit memo( ZCG2) with ref to Billing      ( ZCF2) th

  • Printing issue of grn document

    Hi,     all the setting for print out of grn had been done ,spool request is also generating, but in mb90   after entering required data i.e out type,t med,s order-01,p mode-1,mat doc yr-2009, system give green message-no messages for initial process

  • Can Illustrator CS4 open Illustrator CS6 files? or other work around way to open CS6 files?

    Can Illustrator CS4 open files created in CS6? or can CS6 files be converted to be opened in CS4? like CS6 InDesign can be saved in IDML files to be opened in previous versions. Or if there is any other work around ways, like save CS6 files in PDFs/e