Delete Client and Initialize Client provides several ways to delete client records in JPiere, including deleting an entire client, deleting only client transactions, initializing a client, or using a custom delete profile. It deletes data according to defined transaction tables, initialize tables, and the delete profile. The delete profile allows customizing which data to delete by table and provides options for handling foreign key constraints. System administrators can use reports to confirm which tables and records will be deleted before running the delete process.
Kenya Coconut Production Presentation by Dr. Lalith Perera
JPIERE-0158:Delete Client and Initialize Client
1. OSS ERP Solutions Co., Ltd. All Right Reserved.
JPIERE-0158: Delete Client and Initialize Client
JPiere is plugins of iDempiere
& distributions of iDempiere for Japan.
2. OSS ERP Solutions Co., Ltd. All Right Reserved. 1
Overview
Delete Client and Initialize Client
You will delete records in a Client when you perform Delete Client and Initialize
Client process. JPiere provides 5 ways that delete records as follows.
Delete a Client
Delete a Client Transactions
Delete All Clients Transactions
Initialize a Client
Custom Delete
Kinds of Delete Client and Initialize Client way
"Delete a Client“ deletes all data in a client that you select.
“Delete a Client Transactions” deletes all transaction data in a client that you select.
“Delete All Clients Transactions” deletes all transaction data in all client.
“Initialize a Client” can delete transaction data and master data. All transaction data
is deleted basically. And master data is deleted by “Definition of Delete Profile”.
Delete a Client
Delete a Client Transactions
Delete All Clients Transactions
Initialize a Client
“Custom Delete” delete data according to “Definition of Delete Profile”. You can
delete a Client data flexibly.
Custom Delete
Kinds of "Delete Client and Initialize Client“ ways as follows.
3. OSS ERP Solutions Co., Ltd. All Right Reserved. 2
Overview
About “Delete Profile”
“Delete Client and Initialize Client” process deletes data according by “Definition of
Delete Profile”. "Delete Client and Initialize Client“ process can delete data flexibly
by using “Delete Profile”.
“Definition of Delete Profile” is configuration setting of “Delete Profile”.
Relations of “Delete a Client” and “Delete Profile”
“Delete a Client” don’t use “Delete Profile”. “Delete a Client” need not to customize
because “Delete a Client” deletes all data in a client.
Relations of “Delete (a/All) Client(s) Transactions” and “Delete Profile”
You can add delete tables to use “Delete Profile” at “Delete a Client Transactions”
and “Delete All Clients Transactions”.
Relations of “Initialize a client” and “Delete Profile”
“Initialize a Client” can delete transaction data and master data. All transaction data
is deleted basically. And master data is deleted by “Definition of Delete Profile”.
Relations of “Custom Delete” and “Delete Profile”
“Custom Delete” delete data according to “Definition of Delete Profile”. You can
delete a Client data flexibly.
4. OSS ERP Solutions Co., Ltd. All Right Reserved. 3
概要
About “Transaction Tables” and “Initialize Tables”
You need understand "Transaction Tables" and "Initialize Tables" for performing
"Delete Client and Initialize Client“ process correctly.
Transaction Tables are table that have document data like a order. Transaction Table
defines at Initialize Client and Delete Client process. You can confirm Transaction
Tables at “Delete Tables Confirmation Report”.
Transaction data in Transaction Tables is deleted basically except “Custom Delete”.
About Transaction Tables
About Initialize Tables
Initialize Tables are table that have master data like a Business Partner and a
Product. You can confirm Initialize Tables at “Delete Tables Confirmation Report”.
Initialize Tables is used by “Initialize a Client”. In “Initialize a Client”, “Initialize
Client and Delete Client” process do not delete data that is contained “Initialize
Tables” if “Initialize Table” do not define in Delete Profile. On the other hand, “Delete
Client and Initialize Client” process deletes all data that is not contained “Initialize
Table” and “Definition of Delete Profile”.
“Delete Client and Initialize Client” process defines “Transaction Tables”
and ”Initialize Tables”. You can confirm it at “Delete Tables Confirmation
Report”.
You can customize Delete Client and Initialize Client process flexibly by using
“Delete Profile”. “Definition of Delete Profile” is configuration setting of “Delete
Profile”.
Transaction data in Transaction Tables is deleted basically except “Custom
Delete”.
“In “Initialize a Client”, “Delete Client and Initialize Client” process do not delete
data that is contained “Initialize Tables” if “Initialize Table” do not define in
Delete Profile.
“Delete Client and Initialize Client” process deletes all data that is not contained
“Initialize Table” and “Definition of Delete Profile”.
Points of understand “Delete Client and Initialize Client”
5. OSS ERP Solutions Co., Ltd. All Right Reserved. 4
Overview
Other Overview and Instructions
You can not delete data that is in System Client.
Please back up data before perform “Initialize Client and Delete Client” process
“Initialize Client and Delete Client” process delete session log and change log except
System Client.
You can perform “Initialize Client and Delete Client” process System Client only.
“Initialize Client and Delete Client” process delete data that Import
Tables(I_TableName) and Temporary Tables(T_TableName).
“Super User” can not perform Delete Client and initialize Client Process. Please use
“System User”
Common Error
“Delete Client and Initialize Client Process” invalid Foreign key constraint before
delete. And valid Foreign key Constraint after delete. When valid Foreign key, You
may get Error of Foreign key constraint. Please check log and Delete Profile, data in
data base.
Error of Foreign key Constraint
If you configure to set Null at Delete Profile, You may get Error of Not Null
Constraint. Please check Delete Profile if you get Error of Not Null Constraint.
Error of Not Null Constraint
Data base is PostgreSQL only.
Please reboot iDempiere server after delete.
6. OSS ERP Solutions Co., Ltd. All Right Reserved. 5
Delete Client and Initialize Client Process
Delete Client and Initialize Client Process
Parameters
Delete Client and Initialize Client Process
1000000Client ID
Save Parameters ▼
Delete or Initialize Client Delete a Client Transactions ▼
Truncate
Delete Profile ▼
You have to enter AD_Client_ID that you want to delete.
Client ID
You have to choice a way that delete records as follows.
Delete a Client … "Delete a Client" deletes all data in a client that you select.
Delete a Client Transactions … "Delete a Client Transactions" deletes all transaction data in a
client that you select.
Delete All Clients Transactions … "Delete All Clients Transactions" deletes all transaction data
in all client.
Initialize Client … "Initialize a Client" can delete transaction data and master data. All
transaction data is deleted basically. And master data is deleted by "Definition of Delete
Profile".
Custom Delete … "Custom Delete" delete data according to "Definition of Delete Profile". You
can delete a Client data flexibly.
Delete or Initialize Client
Truncate
If you selected “Delete All Clients Transactions”, Flag of Truncate is displayed. If you tick the
flag, Delete Client and Initialize Client process deletes data by using “Truncate”.
Delete Client and Initialize Client Process
If you perform "Delete Client and Initialize Client Process“, You can delete client and
Initialize client.
Get Log of Update SQL 0
7. OSS ERP Solutions Co., Ltd. All Right Reserved. 6
Delete Client and Initialize Client Process
Delete Profile
You can select Delete profile except “Delete a Client”.
Get Log of Update SQL 0
If you tick this flag, Delete Client and Initialize Client process get the all log of SQL that update
and delete records.
Check of Parameters
You can not perform “Super User”. Please use “System User”.
Check of user
Check of Client ID
If you want to perform "Delete All Clients Transactions", Please Enter 0 to Client ID. Else You
can not enter 0 to Client ID.
Check of Delete Profile
You have to enter a "Delete Profile", When you selected "Initialize a Client" or "Custom Delete".
8. OSS ERP Solutions Co., Ltd. All Right Reserved. 7
Delete Client and Initialize Client Process
Flow of Delete Client and Initialize Client process.
Process flow of "Delete a Client"
Step1:Delete Data of “Transaction Tables”
“Delete a Client“ deletes all data in a client that you select.
Step2:Delete Data of Not “Transaction Tables”
Step3:Delete records that refer to delete Client.
◆Step4:Reset count of Primary key ID.
Reset count of Primary key ID except Prefix of Table Name is “AD_” and current ID less than
1000000.
Process flow of "Delete a Client Transactions"
“Custom Delete” delete data according to “Definition of Delete Profile”. It is handled in
Sequence number.
9. OSS ERP Solutions Co., Ltd. All Right Reserved. 8
Delete Client and Initialize Client Process
Process flow of "Delete a Client Transactions"
Delete a Client Transactions deletes all transaction data in a client that you select.
Step1:Delete Data of "Transaction Tables"
Step2:Set null records that refer "Transaction Tables"
Step3:Reset count of Document number
Step4:Process of Delete Profile
◆Step5:Reset count of Primary key ID
Reset count of Primary key ID to Transaction Tables except Prefix of Table Name is “AD_” and
current ID less than 1000000.
10. OSS ERP Solutions Co., Ltd. All Right Reserved. 9
Delete Client and Initialize Client Process
Process flow of "Delete All Clients Transactions"
Process flow of "Delete All Clients Transactions" is same as Process flow of "Delete a
Client Transactions" basically.
But be careful to tick TRUNCATE flag. TRUNCATE perform with option of "CASCADE"
and ignore WHERE clause of Delete Profile. All records that table is defined in Delete
Profile is deleted.
11. OSS ERP Solutions Co., Ltd. All Right Reserved. 10
Delete Client and Initialize Client Process
Process flow of "Initialize a Client"
Initialize a Client can delete transaction data and master data. All transaction data is
deleted basically. And master data is deleted by Definition of Delete Profile.
Step1:Delete Data of "Transaction Tables".
Step2:Set null records that refer "Transaction Tables".
Step3:Reset count of Document number.
Step4:Delete all data that table is not contained “Initialize Table” and
“Definition of Delete Profile”.
Step5:Process of Delete profile.
◆Step6:Reset count of Primary key ID.
Reset count of Primary key ID except Prefix of Table Name is “AD_” and current ID less than
1000000.
12. OSS ERP Solutions Co., Ltd. All Right Reserved. 11
Delete Profile
Delete Profile
Tab of Delete Profile
Delete Profile [ #/#]
System
Delete Profile
Client* *Oranization*
1000000Search key
testName*
Description
Active
Value = ‘HQ’AD_Org_ID Where
Description= ‘default’AD_Role_ID Where
Description= ‘default’AD_User_ID Where
Initialize ClientDelete or Initialize Client* ▼
You can select next 4 ways that delete or initialize client.
Delete a Client Transactions
Delete All Clients Transactions
Initialize Client
Custom Delete
Delete or Initialize Client
Description= ‘default’C_BPartner_ID Where
M_Product_ID < 0M_Product_ID Where
Modify Client name
Delete Profile
You can customize “Delete Client and Initialize Client Process” flexibly by using
“Delete Profile”. “Definition of Delete Profile” is configuration setting of “Delete
Profile”.
13. OSS ERP Solutions Co., Ltd. All Right Reserved. 12
Delete Profile
AD_Org_ID-WHERE
This field is displayed when you select Initialize a Client. You can input default organization
condition. If you keep blank this field, Organizations are not deleted.
AD_Role_ID-WHERE
This field is displayed when you select Initialize a Client. You can input default Role condition. If
you keep blank this field, Roles are not deleted.
AD_User_ID-WHERE
This field is displayed when you select Initialize a Client. You can input default User condition. If
you keep blank this field, Users are not deleted. If you delete user, Delete Client and Initialize
Client Process updates "CreatedBy" and "UpdatedBy" at "SuperUser".
C_BPartner_ID-WHERE
This field is displayed when you select Initialize a Client. You can input default Business partner
condition. If you keep blank this field, Business Partners are not deleted.
M_Product_ID-WHERE
This field is displayed when you select Initialize a Client". You can input default Product
condition. If you keep blank this field, Products are not deleted.
This field is displayed when you select Initialize a Client. You can input new Client Name in
stead of Initialized old Client Name.
Modify Client name
14. OSS ERP Solutions Co., Ltd. All Right Reserved. 13
Delete Profile
Tab of Custom Delete Profile
Delete Profile > Custom Delete Profile [ #/#]
System
Delete Profile
Client* *Organization*
Description
Active
Sql WHERE
10Sequence*
Table*
testDelete Profile*
Delete data not use
Delete data not use
If you tick on this check box, Delete Client and Initialize Process deletes records that is not
referenced by other records.
Treat of Foreign Key ▼ 0Foreign key ID
Table
Delete Table.
Sql WHERE
You can define a remain record condition. If you keep blank this field, Data in this table is not
deleted(All records remain).
Sequence
Process order.
Tab of “Custom Delete Profile” can define Delete profile flexibly. Important definition that need
to explain is Treat of Foreign key. You can define a way to process data that refer this table
records.
【Caution】Judgment of the records that are using now or not
This flag can not judge correclty if Foreign Key use below reference.
ID / Location / Locator / Account / Assignment / PAttribute / Image / Chart / Color
15. OSS ERP Solutions Co., Ltd. All Right Reserved. 14
Delete Profile
Treat of Foreign Key
Policy of Treat of Foreign Key.
Set NULL ---> If Foreign Key has refer to delete records, set Null except define of Custom
Delete Profile Line.
Set Value ---> If Foreign Key has refer to delete records, set Value except define of Custom
Delete Profile Line.
Delete Records ---> If Foreign Key has refer to delete records, Delete the records except
define of Custom Delete Profile Line.
Mandatory = true ? Delete : NULL ---> If Column of Foreign Key is Mandatory, Delete the
record. If Column of Foreign Key is not Mandatory, set null to the column.
Mandatory = true ? Delete : Value ---> If Column of Foreign Key is Mandatory, Delete the
record. If Column of Foreign Key is not Mandatory, set Value to the column.
Mandatory = true ? Value : NULL ---> If Column of Foreign Key is Mandatory, set Value to
the column. If Column of Foreign Key is not Mandatory, set null to the column.
Mandatory = true ? Value : Delete ---> If Column of Foreign Key is Mandatory, set Value
to the column. If Column of Foreign Key is not Mandatory, Delete the record.
Foreign Key ID
If you select "Set Value" at field of Treat of Foreign Key. Delete Client and Initialize process put
this value into Foreign Key.
Create Custom Delete Profile Line
if you use process of Create Custom Delete Profile Line, you can create custom delete profile
lines that refer this table.
Precautions for use of Create Custom Delete Profile Line Process
・This process can not create line if there are lines already.
・This process can not create line if Foreign Key refer to table by using as follow reference
and name of column is not "ReferredTableName_ID".
Location / Locator / Account / Assignment / PAttribute / Image / Chart / Color
16. OSS ERP Solutions Co., Ltd. All Right Reserved. 15
Delete Profile
Tab of Custom Delete Profile Line
[ # /# ]
System
Delete Profile
Client* *Organization*
Description
Active
10Sequence*
Table*
Custom Delete Profile*
Link Column* ▼
▼Treat of Foreign Key*
Treat of Foreign Key
Policy of Treat of Foreign Key.
Set NULL ---> If Foreign Key has refer to delete records, Set null to this Foreign Key.
Set Value ---> If Foreign Key has refer to delete records, Set Value to this Foreign Key.
Delete Records ---> If Foreign Key has refer to delete records, Delete the records.
0Foreign Key ID
If you want to configuration that is irregular policy treat of foreign key, Please create Custom
Delete Profile Lines.
Table
Table that have Foreign Key refer to parent table record.
Sequence
Process order.
Link Column
Column that refer to parent table record.
Foreign key ID
If you select Set Value at field of Treat of Foreign Key. Delete Client and Initialize Process put
this value into Foreign Key.
Delete Profile > Custom Delete Profile > Custom Delete Profile Line
17. OSS ERP Solutions Co., Ltd. All Right Reserved. 16
Delete Client and Initialize Client Confirmation Reports
Delete Tables Confirmation Report
Parameters
Delete Tables Confirmation Report
Save Parameters ▼
Delete Profile* ▼
Delete Client and Initialize Client Confirmation Reports
This report can list of tables that is defined by Delete Profile. You can confirm Delete way per
Table.
Display All Tables
Report(Excel)
Please refer description column. That column display information of delete way.
18. OSS ERP Solutions Co., Ltd. All Right Reserved. 17
Delete Client and Initialize Client Confirmation Reports
Table Relations Confirmation Report
Parameters
Delete Tables Confirmation Report
Save Parameters ▼
Referenced Table* ▼
This report can list information of foreign key column.
Report(Excel)
This report can list information of foreign key column.
Case of tables that is not able to contain this list
Case of tables that is not able to contain this list
ID / Location / Locator / Account / Assignment / PAttribute / Image / Chart / Color
19. OSS ERP Solutions Co., Ltd. All Right Reserved. 18
Set Up
Pack in 2Pack.zip under META-INF folder
Set up Delete Client and Initialize Client
This report can list of tables that is defined by Delete Profile. You can confirm Delete way per
Table.
2Pack will create the 2 windows and 2 Reports, 1 Process.
Delere Profile(Window)
Delere Client and Initialize Client Log(Window)
Delere Tables Confirmation Report(Report)
Table Relations Confirmation Report(Report)
Delere Client and Lnitialize Client Process(Process)
You can create Table from DDL that is in SQL-DDL folder. If you can't pack in, please
create table from DDL as follows.
JPIERE-0158-JP_DeleteProfile.txt
JPIERE-0158-JP_CustomDeleteProfile.txt
JPIERE-0158-JP_CustomDeleteProfileLine.txt
JPIERE-0158-T_DeleteClientLogJP.txt
Apply process of "Create Custom Delete Profile Line" to Tab of
Custom Delete Profile
After pack in 2Pack.zip, please apply process of Create Custom Delete Profile Line to Tab of
Custom Delete Profile.
20. OSS ERP Solutions Co., Ltd. All Right Reserved. 19
http://www.oss-erp.co.jp/
We can support business challenges of your company
Quickly and at Low cost by using open source.
We are Solution Provider of OSS ERP and Distributor of OSS ERP