Forum Stats

  • 3,872,060 Users
  • 2,266,374 Discussions


disableing an item in enter query mode



  • Tony Garabedian
    Tony Garabedian Member Posts: 3,375
    user619128 wrote:
    Hi tony,
    Thanks for the reply .I am not getting error when i am using the

    set_item_property('EMPNO', enabled, property_false);
    set_item_property('EMPNO', QUERY_ALLOWED, property_false);

    but the error is that even after writing such kind of code in the run time when i am in enter query mode , i am able to insert char or number inside the empno field.

    That is the problem it is behaving like it is not disabled.

    I think now i am clear.


    Edited by: user619128 on Aug 28, 2008 7:44 AM
    In your KEY-ENTQRY write the below code: this is tested on Forms 10g
    If you need to disable querying of an item under a certain condition, include that condition in the trigger too
    IF ... THEN
    END IF;
    This will prevent the user from entering any text in the item when the KEY-ENTQRY trigger is fired. Remember to set it back to true when you cancel the query or when the query is executed.

  • Tony Garabedian
    Tony Garabedian Member Posts: 3,375
    edited Aug 29, 2008 3:51AM
    If you need to prevent the user from querying an item constantly, you can simply use the property palette and set the "Query Allowed" property to "No"

  • 611407
    611407 Member Posts: 418
    edited Aug 29, 2008 5:18AM
    I get the impression you're not reading the replies fully. For example, I said what trigger to put that code in, just above the code snippet, and you've not responded to numerous suggestions that you use the Query Allowed property of the item. Setting that property would be the best way to implement this functionality unless you need the item to be queryable under certain conditions.

    The code I posted above will not work, please accept my apologies. The Enabled property has no effect in enter-query mode. However, this code has been tried and tested:
    if <condition> then
      set_item_property(<item>, queryable, property_true);
      set_item_property(<item>, queryable, property_fase);
    end if;
    The code should go in the key-entqry trigger.
  • 622131
    622131 Member Posts: 40
    Hi tony and u3
    Thank you very much for your support but still even after writting this code into my KEY-ENTQRY trigger in the run time i am able to enter values in the perticular item.

    I am using oracle 6i and the code is

    if :system.mode = 'ENTER-QUERY' then


    set_item_property('empno', queryable, property_false);

    end if;

    can you people please suggest any thing.


    can you please suggest.
  • 611407
    611407 Member Posts: 418
    Answer ✓
    My main suggestion is that you read what people write. The code for the key-entqry trigger does not contain
    if :system.mode = 'ENTER-QUERY' then
    because you are not in enter-query mode at that point. This was only required in the when-new-record-instance trigger but, as I wrote before, that code sample will not work.

    The solution is already here. I'm out.
  • 622131
    622131 Member Posts: 40
    Hi u3 and tony

    Thank you buddy ,thank you very much at last the code compiled and it is working like a dream.
    The field is disabled,and i want to give thank all the people who have give there great idea from there very busy
    schedule.really it is very nice to be in india and communicate with the rest of the world through the forum.

    Thank you every body specially u3 and tony.

    Thanks and Regards
    Anutosh Bhattacharya
  • Tony Garabedian
    Tony Garabedian Member Posts: 3,375
    edited Aug 29, 2008 7:29AM
    you're welcome.

    PS: If your question has been answered, please mark the question as answered, so it helps other people when they search the forums.

    Edited by: Tony Garabedian on Aug 29, 2008 2:29 PM
    Tony Garabedian
This discussion has been closed.