Script to enable attachment on Customer Business Purpose Block in Accounts Receivable

/*  Script to enable attachment on Customer Business Purpose Block.

    Use this script at your own risk as it involves
    updation of FND tables. You can modify this script to
    enable the attachments on other screen.

     TEST IT OUT AND USE AT OWN RISK!!!
*/

DECLARE
l_attachment_function_id NUMBER;
l_attachment_block_id NUMBER;
l_category_id number;
l_document_entity_id number;
l_form_id number;
BEGIN
 SELECT  fnd_attachment_functions_s.nextval,
  fnd_document_categories_s.nextval,
  fnd_document_entities_s.nextval,
   fnd_attachment_blocks_s.nextval
 INTO  l_attachment_function_id,
  l_category_id,
  l_document_entity_id,
  l_attachment_block_id
 FROM  dual;

 SELECT form_id
 INTO l_form_id
 FROM fnd_form
 WHERE form_name = 'ARXCUDCI';

 insert into fnd_attachment_functions values (
   l_attachment_function_id,
   'O',         -- 'O' for Form and 'F' for Function
   l_form_id,
   'ARXCUDCI',  -- Form Name
   '01-SEP-98',
   1,
   '01-SEP-98',
   1,
   1,
   222,         -- Application ID
   NULL,
   'Y');
 

 INSERT INTO fnd_doc_category_usages values
  (fnd_doc_category_usages_s.nextval,
  l_category_id,
  l_attachment_function_id,
  'Y',
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1);

 INSERT INTO fnd_document_categories(
  category_id,
  application_id,
  creation_date,
  created_by,
  last_update_date,
  last_updated_by,
  last_update_login,
  name,
  start_date_active,
  default_datatype_id)
  values
  (
  l_category_id,
  222,          --AR Applications Id
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1,
  'SITE USE CODE',
  '01-SEP-98',
  1
  );

 INSERT INTO fnd_document_categories_tl values
 ( l_category_id,
  'AMERICAN',
  'BUSINESS USES',
  'BUSINESS USES',
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1,
  'N',
  NULL);
 

 insert into fnd_attachment_blocks values
  (l_attachment_block_id,
  l_attachment_function_id,
  'ADDR_SU',         --Block Name
  'N',
  1,
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1,
  NULL,
  NULL,
  NULL,
  NULL,
  'ADDR_SU.SITE_USE_ID',  -- PK of RA_SITE_USES
  NULL);

 insert into fnd_attachment_blk_entities values
  (fnd_attachment_blk_entities_s.nextval,
  l_attachment_block_id,
  'M',
  'Y',
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1,
  'ADDR_SU.SITE_USE_ID',          --PK of SITE_USE_CODE
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  'RA_SITE_USES',   --Table Name
  'N',
  'Y',
  'Y',
  'Y',
  'Y',
  NULL,
  NULL,
  NULL,
  NULL
);
 
 

 INSERT into fnd_document_entities (
  document_entity_id,
  data_object_code,
  application_id,
  table_name,
  entity_name,
  creation_date,
  created_by,
  last_update_date,
  last_updated_by,
  last_update_login
  )
  values(
  l_document_entity_id,
  'RA_SITE_USES', --Table Name
  222,
  'RA_SITE_USES', --Table Name
  NULL,
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1);
 

 INSERT INTO FND_DOCUMENT_ENTITIES_TL VALUES
 (
  l_document_entity_id,
  'RA_SITE_USES',  --Table Name
  'AMERICAN',
  'BUSINESS USES',
  'BUSINESS USES',
  'Y',
  '01-SEP-98',
  1,
  '01-SEP-98',
  1,
  1);

END;
/

Have a Oracle Question
Do you have an Oracle Question?

Oracle Books
Oracle Certification, Database Administration, SQL, Application, Programming Reference Books

Oracle Application
Oracle Application Hints and Tips

Oracle Home
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.