Home » Developer & Programmer » Forms » Record_property (Oracle 10g)
Record_property [message #278758] Mon, 05 November 2007 10:31 Go to next message
mnanias
Messages: 40
Registered: September 2007
Location: AMERICA
Member
Hi,
I have a block and in that i will be displaying a set of records with check box beside them,so now when the block get initialized according to the procedure behind the form check boxes get checked.So now my task is to make sure that the records which are checked shouldn't be able to updated i mean update,insert of that record should be disabled.
I tried to use pre-record,when-new-record,checkbox_checked(),
set_record_property()but i am not able to get the record_number.
I am using oracle 10g.

Thank You.
Re: Record_property [message #278806 is a reply to message #278758] Mon, 05 November 2007 14:06 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What did you plan to do with the SET_RECORD_PROPERTY? Property is a constant ('STATUS') and can be 'changed/insert/new/query'. Which one did you want to use here?

I'd say that PRE-RECORD in combination with the SET_ITEM_PROPERTY might do the job, such as
if checkbox_checked('block.check_box_item')
then
   -- DISABLE UPDATE
   set_item_property('first_item', update_allowed, property_false);
   set_item_property('second_item', update_allowed, property_false);
else
   -- ENABLE UPDATE
   set_item_property('first_item', update_allowed, property_true);
   set_item_property('second_item', update_allowed, property_true);
end if;
Re: Record_property [message #278838 is a reply to message #278806] Mon, 05 November 2007 21:26 Go to previous messageGo to next message
mnanias
Messages: 40
Registered: September 2007
Location: AMERICA
Member
Hi,

Thanks for the reply i did exactly wat u said but its still not working,let me tell u wats the problem i am facing with an example.Lets suppose that i have 5 records in a form and there are few more items in the form but those are not shown on the layout so now lets think that some of the items of that datablock are set as a record and 5 records of those are displayed on layout,now for those five we have 5 check boxes.As the form initialized a procedure gets executed and the records get displayed and at the same time check box gets checked according to the procedure.Now the user will be able to view check boxes some are checked and some are not checked.In our example lets take that last one is checked and the remaining 4 are unchecked,so now as u told me i wrote the if else using set_item_property in pre-record trigger.It executed well and all the records got displayed and the cursor is now on the last record i mean to say on sixth record which is empty,now i clicked on the 5th record and tried to change one of the item in the record and it worked fine i was not able to change,now i went to 4th record which check box is not checked and when i try to change one of the item i was able to and it also went well.
Now when i came back to the 5th record from the 4th one and try to change a item i was able to which i shouldn't be able to thats the problem i am facing since 2 days.
My main task is the record which is checked shouldn't be updated.
As u asked I used query_status in set_record_property but it didn't help me
So please help me in this


Thank You.
Re: Record_property [message #278867 is a reply to message #278838] Tue, 06 November 2007 01:07 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

Now when i came back to the 5th record from the 4th one and try to change a item i was able to which i shouldn't be able

Does it mean that the checkbox in the 5th record isn't checked any more? Because, if it was, trigger would do its job.
Re: Record_property [message #279058 is a reply to message #278758] Tue, 06 November 2007 14:49 Go to previous messageGo to next message
mnanias
Messages: 40
Registered: September 2007
Location: AMERICA
Member
Hi,
Thanks for ur help.
By using set_item_instance_property its working for an extant but now in those fields i have a field which is a drop down list that mean there is a button on the form and when i click on the button a list pops up and i will be able to change or chose any of those,so now as i used the set_item_inst...,when i try to change the field over the field its not allowing me to do which is gud but if i go to the button and select any of the items in the lov the field is getting changed which shouldnt be.
Check box is still checked and the code i wrote in pre-record is
*****
DECLARE

get_item VARCHAR2 (30);
check_box BOOLEAN;
block_id block;
errnum NUMBER := ERROR_CODE;
errtxt VARCHAR2 (80) := ERROR_TEXT;
errtyp VARCHAR2 (3) := ERROR_TYPE;
BEGIN

IF :bpending_aid.cost_transfer = 'Y'
THEN
--set_item_property('BSTUDPEND.LIST_BUTTON',enabled,property_off);
set_item_instance_property('BPENDING_AID.CHARGE_DEPT',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.CHARGE_FUND',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.AIDLINE_START_DATE',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.AIDLINE_END_DATE',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.CHARGE_PROJECT',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.CHARGE_TASK',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.AIDLINE_AMOUNT',current_record,UPDATE_allowed,PROPERTY_false);
set_item_instance_property('BPENDING_AID.AIDSOURCE_NAME',current_record,UPDATE_allowed,PROPERTY_false);
else IF :bpending_aid.cost_transfer = 'N' THEN
set_item_property('BSTUDPEND.LIST_BUTTON',enabled,property_off);
set_item_instance_property('BPENDING_AID.AIDSOURCE_NAME',current_record,UPDATE_allowed,PROPERTY_TRUE);
set_item_instance_property('BPENDING_AID.AIDLINE_AMOUNT',current_record,UPDATE_allowed,PROPERTY_TRUE);
set_item_instance_property('BPENDING_AID.CHARGE_DEPT',current_record,UPDATE_allowed,PROPERTY_true);
set_item_instance_property('BPENDING_AID.CHARGE_FUND',current_record,UPDATE_allowed,PROPERTY_true);
set_item_instance_property('BPENDING_AID.AIDLINE_START_DATE',current_record,UPDATE_allowed,PROPERTY_TRUE);
set_item_instance_property('BPENDING_AID.AIDLINE_END_DATE',current_record,UPDATE_allowed,PROPERTY_TRUE);
set_item_instance_property('BPENDING_AID.CHARGE_PROJECT',current_record,UPDATE_allowed,PROPERTY_true);
set_item_instance_property('BPENDING_AID.CHARGE_TASK',current_record,UPDATE_allowed,PROPERTY_true);
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
MESSAGE (errnum || ' ' || errtyp || ' ' || errtxt);
END;
*******
I want that lov button to be disabled when this cursor goes on to that field which check box is checked and button should be enabled when the cursor goes on to the field which check box is not checked.
Please help me in this.
Thank you.
Re: Record_property [message #279062 is a reply to message #279058] Tue, 06 November 2007 15:16 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What prevents you to disable the button?
set_item_property('push_button', enabled, property_false);
Re: Record_property [message #279076 is a reply to message #278758] Tue, 06 November 2007 18:53 Go to previous messageGo to next message
mnanias
Messages: 40
Registered: September 2007
Location: AMERICA
Member
hi,
Thanks again.
I used this code in when-mouse-click trigger and now it worked.
so now when i open the form and when i click on any of the records according to the check box button is enabled and disabled as well as the fields of the record are also enabled and disabled but now the issue is.The users may also use keys up and down arrow for the navigation from one record to another in that case when they navigate to one record which is unchecked to record which is checked the trigger which is use when-mouse-click will not be fired and the button will not be disabled for the checked record.
So i tried using key-up and key-down triggers but when i wrote the same code which i have written in when-mouse-click and when i try to run the form its running fine but i am not able to navigate from on record to another using up and down arrow.I am sure that because i am using key-up and key-down triggers i tested in all the ways and i came to know abt this.So now wat exactly u want me to do
All i have to do is when the user opens the form and when he clicks the record which is checked button and all other fields of that record should be disabled which i have done that and also when user navigates using up and down arrow same thing should happen.
Please help me in this

Thank You.
Re: Record_property [message #279114 is a reply to message #279076] Wed, 07 November 2007 00:47 Go to previous message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why did you put this code into another (WHEN-MOUSE-CLICK) trigger? Why didn't you put it into the trigger from your previous post (PRE-RECORD)? Just as you allowed updating, enable (or not) this push button.

Not related to the problem, but nevertheless: if you decide to code KEY-UP and KEY-DOWN and put some code into those triggers, don't forget to reenable those key's primary functionality - include UP and DOWN built-ins into the corresponding form triggers.
Previous Topic: how to make button show and hide window ?
Next Topic: .fmx to the users
Goto Forum:
  


Current Time: Sat Dec 10 03:16:02 CST 2016

Total time taken to generate the page: 0.07030 seconds