Home » Developer & Programmer » Forms » check insert data from form and Insert only one record (merged)
check insert data from form and Insert only one record (merged) [message #229067] Thu, 05 April 2007 04:33 Go to next message
u263066
Messages: 47
Registered: March 2007
Member
i have 2 block master and detail(X AND y)

and there is one checkbox, where I have to insert a record another two tables which has master -details.(a,b)

how can I can capture the values from form of details items to be save in table B.

I have used a cursor based of the line, but unable to pull the record from form items,

thanks in advance
Insert only one record [message #229495 is a reply to message #229067] Mon, 09 April 2007 00:26 Go to previous messageGo to next message
u263066
Messages: 47
Registered: March 2007
Member
I have two block
Master and Details in the form.

I have created a check box to save certain field in the another table which is also a master and details relationship.

Here is the code I have written in when Checkbox changed trigger.

Master is creating but in details Only first record get created.
can anyone help where its goes wrong

DECLARE
tot_line 	NUMBER (3);
line 			NUMBER (3);
BEGIN

IF checkbox_checkED('CONTROL.SAVE_AS')THEN
fnd_message.set_string('YOU ARE SAVING A TEMPALTE BASED OUT OF THIS PAYMENT DETAILS.');
fnd_message.show;
insert INTO XXAP_PAYMENT_TEMPLATES VALUES
(
  :XXAP_PMT_REQUEST_HDR.CR_ID          
  ,'1'																																					
  ,:XXAP_PMT_REQUEST_HDR.PAYMENT_TYPE||'-'||:XXAP_PMT_REQUEST_HDR.CR_ID          
  ,:XXAP_PMT_REQUEST_HDR.CR_DATE   
  ,NULL           
  ,:XXAP_PMT_REQUEST_HDR.VENDOR_NAME||:XXAP_PMT_REQUEST_HDR.PAYMENT_TYPE
  ,:XXAP_PMT_REQUEST_HDR.VENDOR_ID                  
  ,:XXAP_PMT_REQUEST_HDR.ORG_ID		     
  ,null                
  ,null       
  ,null                 
  ,null                 
  ,:XXAP_PMT_REQUEST_HDR.VENDOR_NAME                
  ,NULL               
  ,NULL              
  ,NULL                 
  ,NULL                 
  ,NULL                 
  ,NULL                 
  ,NULL                
  ,NULL                
  ,NULL                
  ,NULL                
  ,NULL                
  ,NULL                
  ,:XXAP_PMT_REQUEST_HDR.CREATION_DATE              
  ,:XXAP_PMT_REQUEST_HDR.CREATED_BY                 
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATE_DATE           
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATED_BY            
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATE_LOGIN         
);
fnd_message.set_string('MASTER CREATED');
fnd_message.show;

---SAVE THE DETAILS ALSO
GO_BLOCK('XXAP_PMT_REQUEST_DTLS');
tot_line := GET_BLOCK_PROPERTY ('XXAP_PMT_REQUEST_DTLS', current_record);
FIRST_RECORD;
line:= 1;
lOOP
insert INTO XXAP_PAYMENT_TEMPLATES_DETAILS VALUES
(
  :XXAP_PMT_REQUEST_HDR.CR_ID    				--PAYMENT_TEMPLATE_ID
  ,:XXAP_PMT_REQUEST_DTLS.LINE_PERCENT				--ATTRIBUTE_CATEGORY
  ,:XXAP_PMT_REQUEST_DTLS.LINE_DESC				--ATTRIBUTE1
  ,:XXAP_PMT_REQUEST_DTLS.TAX_CODE				--ATTRIBUTE2
  ,:XXAP_PMT_REQUEST_DTLS.ENTITY				--ATTRIBUTE3
  ,:XXAP_PMT_REQUEST_DTLS.LOCAL					--ATTRIBUTE4
  ,:XXAP_PMT_REQUEST_DTLS.COST_CENTER				--ATTRIBUTE5
  ,:XXAP_PMT_REQUEST_DTLS.REGION 				--ATTRIBUTE6
  ,:XXAP_PMT_REQUEST_DTLS.INTERCOMPANY 				--ATTRIBUTE7    
 ,NULL   							--ATTRIBUTE8
 ,NULL   							--ATTRIBUTE9
 ,NULL  							 --ATTRIBUTE10
 ,NULL  							 --ATTRIBUTE11
 ,NULL   							--ATTRIBUTE12
 ,NULL   							--ATTRIBUTE13
 ,NULL   							--ATTRIBUTE14
 ,NULL    							--ATTRIBUTE15
  ,:XXAP_PMT_REQUEST_HDR.CREATION_DATE          							--CREATION_DATE          
  ,:XXAP_PMT_REQUEST_HDR.CREATED_BY      										--CREATED_BY         
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATE_DATE     							--LAST_UPDATED_BY     
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATED_BY      							--LAST_UPDATED_BY        
  ,:XXAP_PMT_REQUEST_HDR.LAST_UPDATE_LOGIN    							--LAST_UPDATE_LOGIN 
);

EXIT WHEN line= tot_line;
next_record;
line:= line+ 1;
end loop;
COMMIT;
fnd_message.set_string('DETAIL CREATED');
fnd_message.show;
END IF;
END;
Re: Insert only one record [message #230017 is a reply to message #229495] Tue, 10 April 2007 10:16 Go to previous message
tlananthu
Messages: 18
Registered: April 2007
Location: India
Junior Member

In which block and trigger have u written this code?
Previous Topic: LOV AND When validate item
Next Topic: Master Details - Final commit
Goto Forum:
  


Current Time: Wed Dec 07 10:59:22 CST 2016

Total time taken to generate the page: 0.06297 seconds