Home » Developer & Programmer » Forms » how to check all customer numbers by checking select all check box in forms (Forms-6i)
how to check all customer numbers by checking select all check box in forms [message #427138] Wed, 21 October 2009 05:27 Go to next message
anusha539
Messages: 7
Registered: October 2009
Location: Hyderabad
Junior Member
Hi All,

I have one requirement related to check box.In my form i have customer number,customer name.. etc fields,and before customer number i have a check box(cb_1).
select all(cb)
cb_1 customer number customer name
- 1001 ABC Customer
- 1001 ABC Customer
- 1002 XYZ Customer
- 1002 XYZ Customer

If i check customer number ( 1001) check box it should select all 1001 Customers. If i check customer number (1002) check box it should select all 1002 Customers. I have done the above task.But i struck with below task. I need to place a "Select All" Check box at top of the another check box(CB_1) in the form.Where CB_1 is associated with the form fields.when I click on "Select All" check box it should select the CB_1 check box i.e automatically all customer numbers are checked.If i unchecked it then all customer no's are unchecked.

I have written the following code in my form:

for first checkbox(CUSTOMER_NUMBER_CBX):

DECLARE
vCurRec NUMBER;
CURSOR c1 (p_test VARCHAR2)
IS
SELECT CUSTOMER_NUMBER
FROM XXMCS_CUSTOMERS_V
WHERE CUSTOMER_NUMBER = :XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER;
v_name_lov VARCHAR2 (1000);
BEGIN
vCurRec:=:SYSTEM.CURSOR_RECORD;
IF :XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER_CBX = 1
THEN
OPEN c1 (:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER);
FIRST_RECORD;
LOOP
FETCH c1
INTO v_name_lov;


IF :XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER = v_name_lov
THEN
:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER_CBX := 1;
END IF;
IF :SYSTEM.LAST_RECORD = 'TRUE'
THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
GO_RECORD(vCurRec);
else
OPEN c1 (:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER);
FIRST_RECORD;
LOOP
FETCH c1
INTO v_name_lov;


IF :XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER = v_name_lov
THEN
:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER_CBX := 2;
END IF;
IF :SYSTEM.LAST_RECORD = 'TRUE'
THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
GO_RECORD(vCurRec);
END IF;
END;




for second checkbox(CUSTOMER_NUMBER_ALL_CBX):


DECLARE
vValueCB VARCHAR2(1);
vValueCust VARCHAR2(100);
vCurRec NUMBER;
BEGIN
vValueCust:=:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER;
vValueCB:=:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER_ALL_CBX;
vCurRec:=:SYSTEM.CURSOR_RECORD;
LOOP
NEXT_RECORD;
IF :XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER = vValueCust THEN
:XXMCS_CUSTOMER_DETAILS.CUSTOMER_NUMBER_CBX := vValueCB;
END IF;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
NEXT_RECORD;
END LOOP;
GO_RECORD(vCurRec);
END;


Code for first check box is working fine,but for second one is not working.i.e when I click on "select all " check box it is not selecting all customer numbers.
can anyone please help me.

Thank you in advance,
Anusha.
Re: how to check all customer numbers by checking select all check box in forms [message #429531 is a reply to message #427138] Wed, 04 November 2009 07:13 Go to previous messageGo to next message
mudabbir
Messages: 235
Registered: April 2006
Location: Kuwait
Senior Member

Did you solve your problem?
Re: how to check all customer numbers by checking select all check box in forms [message #429532 is a reply to message #429531] Wed, 04 November 2009 07:15 Go to previous messageGo to next message
anusha539
Messages: 7
Registered: October 2009
Location: Hyderabad
Junior Member
Yeah,I solved it Smile
Re: how to check all customer numbers by checking select all check box in forms [message #430735 is a reply to message #427138] Thu, 12 November 2009 01:45 Go to previous messageGo to next message
gozuhair
Messages: 206
Registered: January 2008
Senior Member
Please attached the updated form.
Re: how to check all customer numbers by checking select all check box in forms [message #431183 is a reply to message #430735] Mon, 16 November 2009 01:22 Go to previous message
anusha539
Messages: 7
Registered: October 2009
Location: Hyderabad
Junior Member
Hi,

Find the updated fmb in attachment.


Regards,
Anusha.
Previous Topic: How ot call a canvas froma form?
Next Topic: same timing should show message
Goto Forum:
  


Current Time: Sun Dec 11 06:30:03 CST 2016

Total time taken to generate the page: 0.11584 seconds