[2pack] Packout reference table call wrong ElementHandler.packOut overloading

Description

to do 2pack for role of client gardenworld, i define a packout with detail record follow Packout reference table :

type = data
table = AD_Role
sql = SELECT * FROM AD_Role WHERE AD_Role_UU='66ad18b5-262f-42fe-bf02-e868ef0fdb2b';AD_Role_OrgAccess

i attach my pack out define at

when run packout i get error "AD_Role_OrgAccess doesn't have ID, use method with UUID"

Test Case 2:

Type = Data
Table = AD_Org
SQL Statement = SELECT * FROM AD_Org WHERE AD_Org_ID=11;AD_Role_OrgAccess

Environment

None

Activity

Show:
Carlos Ruiz
April 24, 2020, 8:50 PM

Hi , haven't tested but I checked the patch and I notice you're changing this approach:

by this different:

That doesn't look good in case GenericPOElementHandler is used to process a table that don't have an ID column.

Regards,

Carlos Ruiz

Hiep Lq
April 24, 2020, 9:20 PM

in that case then call to function handler.packOut(ctx.packOut, document, ctx.logDocument, po.get_ID());
also not good.
because po.get_ID() return id of parent table but handler.packOut expect id of current record
it's also not predicate on case multi parent.
example AD_Role_OrgAccess has two parent AD_Role and AD_Org then po.get_ID() return AD_Role_ID or AD_Org_ID depend one order of columns on POInfo.m_columns (order by AD_Column_ID isn't meaning value)

Hiep Lq
April 24, 2020, 10:32 PM

>That doesn't look good in case GenericPOElementHandler is used to process a table that don't have an ID column.

is packout product with M_Product_PO and it still work well after apply my patch
M_Product_PO is a table without ID
(don't like AD_Role_OrgAccess has OrgRoleElementHandler to handle M_Product_PO hasn't any ElementHandler for it)

Assignee

Heng Sin Low

Reporter

Hiep Lq

Labels

Tested By

None

Fix versions

Priority

Major
Configure