How to validate non commited items in detail block.

Hi All,
I have a Detail block with 10 rows and 2 columns. the select of items is based on LOV. If i select One item in one row, then the user cannot select the same item again in other rows. either I need to not show the selected item in LOV or I need to raise form trigger failure and ask him to change values. This is to be done before commiting the items. Can anyone, please suggest me some way or triggers I can use.
Thank you.

If the process is done by a key-commit trigger or a when button-pressed trigger then it is simple . But if there is no such trigger then you should create it because it is more convenient to make controls inside key-commit rather than in pre-update or pre-insert because these triggers do not accept restricted built-ins.
To validate your items just loop through the list of records and compare the values to the one you are on. Then if there are no match then you go to the next record to search for.
Something like this :
declare
v_current_value_to_compare varchar2(100);
v_record pls_integer;
begin
go_block('detail_block_name');
first_record;
while :system.last_record = 'FALSE' loop
loop
next_record;
v_current_value_to_compare := :detail_block_name.item_name;
v_record := :system.trigger_record;
if :detail_block_name.item_name = v_current_value_to_compare then
-- make your control here
end if;
exit when :system.last_record = 'TRUE';
end loop;
go_record(v_record);
end loop;
end;

Similar Messages

  • How to validate date between Header and Detail Block..

    Hi All,
    I was trying to find a way where, suppose I enter 'from date' and 'to date' in the header block.then in detail block all 'from dates' and 'to dates' should be restricted between the dates entered in the header block.
    Thank you

    Or U Can Simply set in the child item lowest / highest Allowed Value
    Invoke Property pallete for child date item and set the following
    lowest Allowed Value :header.from_date (must be prefix with :)
    Highest Allowed Value :header.to_date
    siju.koiply

  • Duplicate Item in Details Block

    Dear Expert,
    I written some code for checking of the same item in detail block, when I am using keyboard it is runing ok, but when I nevigate the same from mouse to another item, it will not check the duplicate item, my problem is when I move the mouse from one filed to another my Item-Code will be validate every time when I leave the mouse from One Item to another.
    Please give me your expert adive.
    s mishra

    Hi Mark,
    Actually this my code but it doesn't work.....
    if :slcl.bulk_question_answer = 'N' then
    Set_Item_Instance_Property('SLCL.BULK_ERROR_DETAILS', CURRENT_RECORD, UPDATE_ALLOWED,PROPERTY_TRUE);
    elsif :slcl.bulk_question_answer = 'Y' then
    Set_Item_Instance_Property('SLCL.BULK_ERROR_DETAILS', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
    :SLCL.BULK_ERROR_DETAILS := '';      
    end if;
    Please remember I put this code in the when-checkbox-changed trigger the default if YES.
    Any further advice or idea are greatly appreciated....
    Thanks.
    Regards,
    Jun

  • How to include non database item in the query

    Hi
    I have a Master-Detail form. where in the detail block one of the field is text item 'X' attached the list of values(Y). Master block includes non database items which is based in the decoding result of the database items for example:
    Gender(Male, Female)>> non database item
    Gender_id(M,F)>>database item
    the form is created based on the template.fmb form for apps. When I run the form in the query mode, i can query about any database item while including query about others non database item does not affect.
    how to can i modify it so this could be handled??
    I know that one way to avoid this issue is to create a view with all my desired field.
    but there should be away to override the build in query used by oracle apps...
    any one has a link, source, document... etc that help on this??
    any idea how to do it without creating a view??
    thnx alot

    Hi HST,
    You can code the handling in POST-Query of the corresponding block to retrive the corresponding data depending on the Queried data.
    Regards,
    Kiran

  • How to validate the line item values in OFR - quantity , unit price and UOM

    Hi All,
    Is there any possibility to validate the line items like quantity, unit price and UOM against the DB and stops those invoices at verifier (1 batch =10 invoices) level  if yes could you please let me know the process how to proceed further.
    due to this some the invoices are coming to OFR is with incorrect quantity, UOM and unit price different from PO lines information like quantity , UOM and unit price and those invoices are not validating from the DB and these are processed to EBS and it's effecting the GL and reporting.
    Regards,
    Anil

    Hi ,
    I did not get the exact requirement.Let me bit:
    In standard AP project lines validation will try to compare the quantity , unit price and UOM of line against the database for match which actually performed on export.
    So even if match fails batch will be exported.Now if you want to correct it before EBS,i think you can do it in the business process easily that you are consuming whether BPEL/BPM process.
    We have done this in several projects
    =========================
    But If you want that to be done from OFR side i think we need to code  UserExitPONumberValidate event to  compare the line items values against database.I need to test this also.

  • How can we change "Commitment item" to diplay mode in P.O?

    Hi,
    Our user want that the "Commitment item" field should be a in a display mode in Purchase Order in sap.
    Please suggest how can we do that.
    Thanks and Regards
    Nitin

    Hi Nitin,
    You can select the field status for your commitment item in transaction OME9.
    - Go to TCode OME9
    - Select the account assignment category that you are using
    - here you can do the SDRO (Suppress,display,required,optional) settings for your account assignment elements.
    Hope this helps.
    Thanks & Regards
    Anshu
    Edited by: Anshu Dixit on Dec 26, 2011 1:11 PM

  • How to query non database items

    hi every one
    I have database block has database items and non database items
    i want to make query in that non database items to retrieve data by that non database items and database items
    thinks

    Hi Every one
    I want to use the non databsae item in query to retireve data by it
    Example
    In table emp
    emp_id
    emp_name
    Dept_id
    But in Form
    Emp_name
    Dept_name
    When endtr data open lov to retireve Emp name and emp id
    and when enter department name in table enter dept id but in form user see dept name in form .
    but if he try to use dept name in query he can't because it non database item .
    How can i use this item in my query to retireve data by dept name ?

  • How to convert non stock item in to stock item.

    hi
    cud any one let me know how will in convert non stock item in to stock item.
    regards
    manish sharma

    Dear Manish.
    please check the below link for your answers. Before posting any question please do check the forum. That's the easy way to find an answer.
    Change item category in a PO
    Non-Stock items convert to Stock
    Hope it will help you.
    Regards,
    Alok Tiwari

  • How to exclude non-released items in the COLLECTION_COPY_ALL service call?

    I am using IdcCommand to copy all content items from one folder to another folder (archives folder) on every day.
    # Copy the latest version of the file from source location to target location
    @Properties LocalData
    IdcService=COLLECTION_COPY_ALL
    fromhasCollectionPath=true
    fromdCollectionPath=/Contribution Folders/folderA/
    tohasCollectionPath=true
    todCollectionPath=/Contribution Folders/folderB/
    @end
    <<EOD>>
    But this service also copies the unreleased/unpublished work-items from the workflow with dCollectionPath=/Contribution Folders/folderA/. How can I exclude the non-released items in the COLLECTION_COPY_ALL service call?

    Vipin Pillai wrote:I changes the source and target folders in the hda file dynamically as part of the requirement; these dynamic changes are not possible with Archiver. The archiver option is a complicated way of doing it. Actually that's not correct. It's actually much easier to use Archiver, but it requires some reading.
    You can certainly use dynamic values in Archiver, as the import map value fields are Idoc scriptable - it's just not openly obvious to do this. To illustrate, suppose I have a a custom field called "xSaleDate". I can export items out, and reimport them, applying today's date to the xSaleDate field using <$dateCurrent()$> in the import map field. Historically I tend to create custom components and put very complex logic in a resource include ("myExternalLogic"), and then in Archiver, in the import map just put <$include myExternalLogic$>.
    You can also do the same logic in a profile rule, which is even easier than an import map. Then the auto archiver suggestion becomes very powerful, and way simpler. I've done very many variations of this over the years, and it works well. Again it just requires some reading.

  • How to value non-table items in Forms

    Portal 3.0.7.6.2 on NT
    I am trying to display non-table items on a Form. I want to do things like: Display the Credit Card Type (non-table item) based on the Credit Card Number (table column). Use a foreigh key (table column) to retrieve related data for display/information only on the Form. The doesn't appear to be p_session variables for these 'added' Form items so I can't use the p_session functions. Any ideas??? I'd prefer a PL/SQL solution.

    Hi Michael,
    As Dmitry said that values for non table form field cannot be displayed completely using pl/sql, u can use some pl/sql and some javascript to achieve this .
    Say, take the example of the Emp table where I would like to display the department name for the deptno. Here I'll use pl/sql to retrieve the value of department name using the deptno and use javascript to display the results in the new field added to the form.
    Steps :
    1> Create a form say, on the emp table
    2> In the field formatting section, add a new item of the type text box and add a javascript event onFocus and give the foll javascript function call for the same :-
    javascript:getval(this)
    3> In the additional pl/sql section, for the "after displaying page ..." part we'll add the following pl/sql code :-
    declare
    l_dno number(4) default null;
    l_desc varchar2(100);
    begin
    l_dno := p_session.get_value_as_NUMBER
    (p_block_name => 'DEFAULT',
    p_attribute_name => 'A_DEPTNO',
    p_index => 1);
    if l_dno is not null then
    begin
    select dname into l_desc
    from scott.dept
    where deptno = l_dno;
    exception
    when others then
    null;
    end ;
    end if;
    htp.p('<script>');
    htp.p('function getval(ele){'&#0124; &#0124;chr(10)&#0124; &#0124;
    'ele.value = "'&#0124; &#0124;nvl(l_desc,' ')&#0124; &#0124;'";}');
    htp.p('</script>');
    end;
    4> Run the form and perform a query. Place the cursor on the desc field after the page reloads with results. The department name would come up.
    Hope this helps.

  • How to make the commitment item field as display in PR and PO

    Hi,
    Our user want the 'Commitment Item' filed should only be diplayed while making PR and PO. Please suggest what to do.
    Shall, I make the field surpass for that FSG and it will show as surpass in all the enjoy transactions or there is something else I should do..
    Thanks in advance
    Regards
    Nitin

    Thanks for your reply ELI!!!
    Actually, users are changing the commitment items and that's why finance people are facing the problems so they have requested to mark the Commitment item field in a display mode.
    Please telll me the t. code or the path where to do this as I am not an MM consultant and he has left recently I have been asked to do it.
    Thanks in advance...
    Regards
    Nitin

  • [Forms 10] How to activate all buttons in a details block?

    Hi,
    I have a details block based on products. (10 lines)
    I have a block_buttons with a button on the same canvas.
    I set the block_buttons number of records to 10 so that the buttons and the records are aligned.
    [prodno] [button] <-- active
    [prodno] [button] <-- disabled
    [prodno] [button] <-- disabled
    [prodno] [button] <-- disabled
    [prodno] [button] <-- disabled
    At the moment only the first button is active.
    The 9 buttons under it are disabled.
    I can't find if I have to set a property or to write code to enable the 9 buttons under the first one.
    Thanks for your help.

    Hi,
    I have managed to get the buttons list to be actve.
    I have created a testbuttons table with a chkbx column.
    I added a checkbox list to the block.
    The button can't be a database item, but the checkbox can.
    Then if I execute_query on that block all items are activated.
    Now I'll try creating a PLSql table on the client side and try using it as support for the control block.

  • How to know all the items into a block

    Hello everybody.
    Im working with Forms and Reports 10G.
    A fast question.
    I need to know all the items into a block.
    I know that with the get_block_property first_record and Last_record I can know the first and last item into a record but
    how I can know all the others?
    Thanks in advanced and regards to all.
    Happy Cristmast

    You can the fisrt item in a block by using GET_BLOCK_PROPERTY('BLOCKNAME', FIRST_ITEM);
    then loop over the item
    LOOP
      vcItem:=GET_ITEM_PROPERTY(vcItem, NEXTITEM);
      EXIT WHEN vcItem IS NULL;
    END LOOP;

  • How to validate a date item  "DD/MM/YYYY HH24:MI" ?

    Hi,
    I want to create a validation item. I have a date item usinhg this mask : "DD/MM/YYYY HH24:MI".
    I want to validate if a date entered according to this syntax "DD/MM/YYYY HH24:MI"
    Unfortunately APEX gives me only the choice to validate if a date is under the form "DD/MM/YYYY" which gives this syntax :
    ^([012]?[[:digit:]]|3[01])/(0?[[:digit:]]|1[012])/[[:digit:]]{4}$I don't know this syntax, do you know how I could transform it (I mean adding the hours and minutes criteria) to attain my goal ?
    Sorry for my english, not perfect, today !
    Regards,
    Christian

    Try this:
    SELECT REGEXP_INSTR('04-OCT-2011 23:12',
    '^([012]?[[:digit:]]|3[01])-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-[[:digit:]]{4}[[:space:]][0-2][0-9]:[0-9][0-6]$') test_result
    FROM dualFor case-insenstive matching, use below:
    SELECT REGEXP_INSTR('04-OCT-2011 23:12',
    '^([012]?[[:digit:]]|3[01])-(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-[[:digit:]]{4}[[:space:]][0-2][0-9]:[0-9][0-6]$',1,1,0,'i') test_result
    FROM dualThanks!
    JMcG

  • How to validate a text item/display item in Oracle forms 9i?

    Hello Everyone,
    I have a form in which we have to type in a product_id as shown below in the screenshot. And when we type in, it has to get validated.
    If it is valid then ok, else display a message saying not valid.
    How do we achieve it on a text box/diaply item in the form shown below.
    Any kind of help would be really appreciated.
    Thanks in advance,
    Vishal

    Just create a when-validate-item trigger for that text item and write the code inside to validate it.
    Hope it helps.
    Navnit

Maybe you are looking for