My Function is Not Working [message #289885] |
Wed, 26 December 2007 07:07 |
siva27
Messages: 41 Registered: April 2007 Location: Chennai
|
Member |
|
|
Dear All,
I have designed a form.In which in have created new Customer and having no Item list for this Customer.And i have taken an exsisting Customer which have Item in it.
When i press VIEW button it should pick the Old Customer Item Details and press "SAVE" means Items have to sit into New Customer List.
In the View Button i have written the code like this ;
PROCEDURE VIEW_CUSTOMER IS
pre_cust_name varchar2(240) := null;
cursor c1 is
select * from jnpp_stding_orders
where organization_id = :ctrl_blk.inv_org_id
and std_type = :ctrl_blk.std_type
and customer_id = :cust_ctrl_blk.copy_customer_id
and cust_add_id = :cust_ctrl_blk.copy_cust_site_id
and active_flag = 'A
and ITEM_ID NOT IN
(select ITEM_ID from jnpp_stding_orders
where organization_id = :ctrl_blk.inv_org_id
and std_type = :ctrl_blk.std_type
and customer_id = :cust_ctrl_blk.customer_id
and cust_add_id = :cust_ctrl_blk.cust_site_id
and active_flag = 'A');
begin
--check whether inv org exist?
if :ctrl_blk.inv_org_id is null AND :then
ok_alr('Inventory org not found....');
return;
end if;
if :cust_ctrl_blk.COPY_CUST_ADD_SITE is null then
ok_alr('Enter the Copy Site 1st..');
return;
end if;
go_block('JNPP_STDING_ORDERS2');
:global.cflag := 'N';
for r1 in c1 loop
if :jnpp_stding_orders2.item_id is not null then
next_record;
end if;
:jnpp_stding_orders2.ORGANIZATION_ID := r1.ORGANIZATION_ID;
:jnpp_stding_orders2.STD_TYPE := r1.STD_TYPE;
:jnpp_stding_orders2.ITEM_ID := r1.ITEM_ID;
:jnpp_stding_orders2.CUSTOMER_ID := :cust_CTRL_BLK.CUSTOMER_ID;
:jnpp_stding_orders2.CUST_ADD_ID := :cust_CTRL_BLK.CUST_SITE_ID;
:jnpp_stding_orders2.CUST_CODE := :cust_CTRL_BLK.CUST_CODE;
:jnpp_stding_orders2.STD_TYPE := r1.STD_TYPE;
:jnpp_stding_orders2.qty := r1.qty;
:jnpp_stding_orders2.ACTIVE_FLAG := r1.ACTIVE_FLAG;
:jnpp_stding_orders2.DAILY_QTY := r1.DAILY_QTY;
:jnpp_stding_orders2.DAILY_ACTIVE_FLAG := r1.DAILY_ACTIVE_FLAG;
:jnpp_stding_orders2.CUSTOMER_DISCOUNT := r1.CUSTOMER_DISCOUNT;
:jnpp_stding_orders2.ITEM_CODE := r1.ITEM_CODE;
:jnpp_stding_orders2.STD_PRICE := r1.STD_PRICE;
end loop;
first_record;
:global.cflag := 'Y';
END;
Can any pls help me in thid coding.If not pls let me know i will be clear..
Pls bit urget..
Thanks,
Sivaprasad.
[EDITED by LF: reformatted and added CODE tags]
-
Attachment: JNPSTDSU.fmb
(Size: 680.00KB, Downloaded 957 times)
[Updated on: Wed, 26 December 2007 09:10] by Moderator Report message to a moderator
|
|
|
|
Re: My Function is Not Working [message #289984 is a reply to message #289968] |
Thu, 27 December 2007 00:35 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
"My function is not working": what does it mean? We don't have your schema and can not run the form you attached. I've already reformatted the procedure you wrote, but that's all I'm about to do until you explain what's wrong - is there an error? If so, which one? Does the procedure work, but there's no result in the form block? Something else?
|
|
|