Single form but multiple type wise data save


if you want multiple type wise single data (as like company) store. This lesson for you

Part-1 - New data Store/Create :
=====================

Step - 1
=====

Suppose, your column name "TYPE"

Go to page edit and select "TYPE" item.
and select List of Value

Select type - Checkbox Group

Server-type-Condition
Type --> Item is Null
Item --> P55_ID

Step -2
=====

CREATE OR REPLACE TYPE  "MYTABLETYPE" as table
of varchar2 (32000) 
/

====================================

CREATE OR REPLACE function in_list_colon( p_string in varchar2 ) return myTableType
 as
 l_string long default p_string || ':';
 l_data myTableType := myTableType();
 n number;
 begin
 loop
 exit when l_string is null;
 n := instr( l_string, ':' );
 l_data.extend;
 l_data(l_data.count) :=
ltrim( rtrim( substr( l_string, 1, n-1 ) ) );
 l_string := substr( l_string, n+1 );
 end loop;

 return l_data;
 end;
/


Step -3
=====
Write down SAVE/UPDATE process (Following this code)

UPDATE setup_party_com SET
PARTY_ORG_ID=:P55_PARTY_ORG_ID,
PREFIX=:P55_PREFIX,
COMPANY_NAME=:P55_COMPANY_NAME,
LICENCE_NO=:P55_LICENCE_NO,
CONTACT_PERSON=:P55_CONTACT_PERSON,
COUNTRY=:P55_COUNTRY,
PHONE=:P55_PHONE,
CITY=:P55_CITY,
MOBILE=:P55_MOBILE,
STATE=:P55_STATE,
EMAIL=:P55_EMAIL,
POSTCODE=:P55_POSTCODE,
ADDRESS=:P55_ADDRESS,
FAX=:P55_FAX,
TYPE=:P55_UPDATE_TYPE,
STATUS=:P55_STATUS,
COM_ID=:GCOM_ID,
UPDATE_BY=:GUSER_ID,
UPDATE_DATE=SYSDATE
 WHERE ID=:P55_ID;
    IF SQL%NOTFOUND THEN
insert into setup_party_com 
(id,PARTY_ORG_ID,PREFIX,COMPANY_NAME,LICENCE_NO,CONTACT_PERSON, 
COUNTRY,PHONE, CITY,MOBILE,STATE,EMAIL,POSTCODE,ADDRESS,FAX, 
STATUS, COM_ID, CREATE_BY, CREATE_DATE,type)  
(
select PARTY_COMPANY_SEQ.NEXTVAL,
:P55_PARTY_ORG_ID,
:P55_PREFIX,
:P55_COMPANY_NAME,
:P55_LICENCE_NO,
:P55_CONTACT_PERSON,
:P55_COUNTRY,
:P55_PHONE,
:P55_CITY,
:P55_MOBILE,
:P55_STATE,
:P55_EMAIL,
:P55_POSTCODE,
:P55_ADDRESS,
:P55_FAX,
:P55_STATUS,
:GCOM_ID,
:GUSER_ID,
SYSDATE,
 COLUMN_VALUE FROM TABLE(in_list_colon(:P55_TYPE))
 );
END IF;

Finally store/Save your Data type wise (Look at this)


Part-2 - Update  Existing data 
====================
Create Item --> UPDATE_TYPE       (page number soho process a ase)
type --> Radio Group
List of Value --> Static/sql query/Shared Component

Server-type-Condition
Type --> Item is Null
Item --> P55_ID

Look at update view----

Single type change or update

Post a Comment

Previous Post Next Post