Home » Developer & Programmer » Forms » problem (forms 6i)
problem [message #393061] Fri, 20 March 2009 03:49 Go to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
hi,
What's my requirement is i want to enable some records in detail table and some records to disable.
I have a check-box in master block. if i select that only first record in the detail block should get enabled and other records in the detail block should get disabled automatically.
Please help me how to get this.........

Re: problem [message #393065 is a reply to message #393061] Fri, 20 March 2009 04:00 Go to previous messageGo to next message
azamkhan
Messages: 557
Registered: August 2005
Senior Member
Create a WHEN-NEW-RECORD-INSTANCE trigger on the block and check if the :System.Cursor_Record > 1 then set_record_property to disabled else let it enable.

Regards,
Azam Khan
Re: problem [message #393070 is a reply to message #393065] Fri, 20 March 2009 04:14 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
I wrote the following code in WHEN_NEW_RECORD_INSTANCE, but i am getting error
as wrong number of types.
in this property i have to specify record number. BUt my requirement is except first record ,the remaining should get disabled
the code i wrote is
 
DECLARE
BEGIN
 IF :T_CBJ_MST_BLOCK.SERVICE_TAX = 'N' THEN
  IF :SYSTEM.CURSOR_RECORD >1 THEN
   SET_RECORD_PROPERTY('T_CBJ_DTL',ENABLED,PROPERTY_FALSE);
  END IF;
END IF;
END;

tell me sir how can i overcome this problem.

[EDITED by LF: applied [code] tags]

[Updated on: Fri, 20 March 2009 05:28] by Moderator

Report message to a moderator

Re: problem [message #393086 is a reply to message #393065] Fri, 20 March 2009 05:12 Go to previous messageGo to next message
jyothi_k
Messages: 1
Registered: March 2009
Junior Member
Can Anyone give some suggestions to develop this application
Re: problem [message #393088 is a reply to message #393061] Fri, 20 March 2009 05:19 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
YOu can use go_record/next_record etc commands in your button to go to each record in turn and disable it.
Re: problem [message #393096 is a reply to message #393070] Fri, 20 March 2009 05:38 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
sivajyothi.kalikiri
i am getting error as wrong number of types.

This is most probably because of invalid use of the SET_RECORD_PROPERTY built-in, as there's no such property. Perhaps you should read documentation to get familiar with procedures you intend to use in your application.

Basically, you'll need to modify item (not record!) properties.
Re: problem [message #393116 is a reply to message #393088] Fri, 20 March 2009 06:22 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
Can u tell me clearly sir...........
Re: problem [message #393120 is a reply to message #393061] Fri, 20 March 2009 06:41 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
look up set_item_instance_property
Re: problem [message #393122 is a reply to message #393120] Fri, 20 March 2009 06:45 Go to previous messageGo to next message
sivajyothi.kalikiri
Messages: 29
Registered: March 2009
Junior Member
I tried that one also.
i changed my code like this.

IF :T_CBJ_MST_BLOCK.SERVICE_TAX = 'N' THEN
GO_BLOCK('T_CBJ_DTL');
FIRST_RECORD;
LOOP
NEXT_RECORD;
IF :SYSTEM.CURSOR_RECORD<>1 THEN

set_item_instance_property('T_CBJ_DTL.SL_NO',CURRENT_RECORD,INSERT_ALLOWED,PROPERTY_FALSE);
set_item_instance_property('T_CBJ_DTL.SL_NO',CURRENT_RECORD,UPDATE_ALLOWED,PROPERTY_FALSE);
set_item_instance_property('T_CBJ_DTL.SL_NO',CURRENT_RECORD,VISUAL_ATTRIBUTE,'DISABLE_COLUMN_COLOR');

END IF;

but i am getting an error as no such propery exists........
Re: problem [message #393123 is a reply to message #393061] Fri, 20 March 2009 06:53 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
So debug your code and find out which property it's complaining about - insert message commands between the lines of code see which one is giving the error.

EDIT: I can't spell debug apparently

[Updated on: Fri, 20 March 2009 06:53]

Report message to a moderator

Re: problem [message #393237 is a reply to message #393123] Fri, 20 March 2009 15:46 Go to previous message
nastyjillu
Messages: 211
Registered: February 2009
Senior Member
Hi Jyothi,

you have worngly written set_record_property function.
below given is the proper usage.

Set_Record_Property( 3, 'EMP', STATUS, QUERY_STATUS);

in form builder help type set_record_property and see the syntax and usage.

if you have anything not working, dont get tensed. form builder help solves most of the things. only thing is you should know how to make use of it.

think logically about what you really want and what logic you should use . ok??

thanks
raghu
Previous Topic: order by non-database item
Next Topic: Conditions on same column but two different values
Goto Forum:
  


Current Time: Sun Feb 09 11:04:36 CST 2025