idempiere-rest release 10 facing issue randomly - Get POs with exception: No PK nor FK

174 views
Skip to first unread message

Syed

unread,
Jul 17, 2025, 12:01:25 PMJul 17
to iDempiere
Dear Team,
Please let me know the reason for the following issue while creating new record using rest api.  Sometimes this error is resolved after cache rest and sometimes this error comes even after cache reset.   

idempiere-rest.png
Get POs with exception: No PK nor FK - TF_EmpShiftAssignment"

I really appreciate your help in resolving this issue permanently.
Thanks in advance

Regards,
Syed.

Gaurav Sontakke

unread,
Jul 17, 2025, 12:54:55 PMJul 17
to idem...@googlegroups.com
Hi 

Is TF_EmpShift foreign key ?

Ideally it should end with _ID & check share the column definition from the application dictionary. 

Regards
Gaurav

On 17 Jul 2025, at 7:01 PM, Syed <sy...@syvasoft.com> wrote:

Dear Team,
Please let me know the reason for the following issue while creating new record using rest api.  Sometimes this error is resolved after cache rest and sometimes this error comes even after cache reset.   

<idempiere-rest.png>
Get POs with exception: No PK nor FK - TF_EmpShiftAssignment"

I really appreciate your help in resolving this issue permanently.
Thanks in advance

Regards,
Syed.


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/idempiere/294c4e49-99da-42c3-9494-18e2ffac86dbn%40googlegroups.com.
<idempiere-rest.png>

Jesús Castillo

unread,
Jul 18, 2025, 6:09:21 PMJul 18
to idem...@googlegroups.com
Hi, 

It happens when tables don´t have any ID column. For example TF_EmpShiftAssignment_ID
 
Atte: Jesus Castillo.


Syed Vaisul Karne M

unread,
Jul 22, 2025, 4:58:56 PMJul 22
to idem...@googlegroups.com
 
TF_EmpShift is the table name.
It says that this doesn’t have PK or FK though it has primary key in standard naming convention 



Kind regards,
Syed,
MD
SyvaSoft Business Solutions Pvt Ltd


You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/P_siJaZ9R94/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/idempiere/B37AC0DA-8775-460F-BB82-CB78244789DB%40shaik.net.

Syed Vaisul Karne M

unread,
Jul 22, 2025, 4:58:56 PMJul 22
to idem...@googlegroups.com
Hi Jesus,

These two tables (TF_EmpShift and TF_EmpShiftAssignment) have their primary key as per iDempiere standard. 
Records are created through webui interface. These FK PK errors occasionally happen while calling through rest api. Please note that this error is not always happening, but only sometimes through rest api. After resetting cache, sometimes this issue is resolved.

My observation is that PO Cache is not loading properly these table Application Dictionary definitions because this sceanrio, the highlighted error are occurred.


Kind regards,
Syed,
MD
SyvaSoft Business Solutions Pvt Ltd

You received this message because you are subscribed to a topic in the Google Groups "iDempiere" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/idempiere/P_siJaZ9R94/unsubscribe.
To unsubscribe from this group and all its topics, send an email to idempiere+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/idempiere/CAFAT%3DLTgTei687uY%2BXws4kSA8PogJNbT4U%2B8dWCaS3StcRx86g%40mail.gmail.com.

Luis Amesty

unread,
Jul 23, 2025, 3:42:37 AMJul 23
to iDempiere
Hi Syed
You need a Model Factory Plugin with X_TF_EmpShift, I_TF_EmpShift , X_TF_EmpShiftAssignment and I_TF_EmpShiftAssignment
This necessary for Api rest.
Do you have it ?

Regards

Syed

unread,
Jul 25, 2025, 8:29:00 AMJul 25
to iDempiere

Hi Team,

In the following query, the primary key column record is sometimes skipped, which results in the error: “NO PK, nor FK”.

Upon investigation, it appears that the isKey column marked as 'Y' is not being interpreted correctly, causing the primary key column to be ignored during processing.

Interestingly, when I manually select AD_Client_ID as the Parent Link Column, the issue is resolved. This suggests that the primary key metadata might be inconsistent.

It's worth noting that the key column data appears suspicious after the pack-in process, likely because the original configuration was done in a different iDempiere instance.


SQL for Load PO Info
SELECT
t.TableName, c.ColumnName,c.AD_Reference_ID,
c.IsMandatory,c.IsUpdateable,c.DefaultValue,
e.Name,e.Description, c.AD_Column_ID,
c.IsKey,c.IsParent,
c.AD_Reference_Value_ID, vr.Code,
c.FieldLength, c.ValueMin, c.ValueMax, c.IsTranslated,
t.AccessLevel, c.ColumnSQL, c.IsEncrypted,
c.IsAllowLogging,c.IsAllowCopy,t.IsChangeLog
FROM AD_Table t
INNER JOIN AD_Column c ON (t.AD_Table_ID=c.AD_Table_ID)
LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID)
INNER JOIN AD_Element  e  ON (c.AD_Element_ID=e.AD_Element_ID)
WHERE
t.AD_Table_ID=1000502
 AND c.IsActive='Y'
 ORDER BY c.AD_Column_ID

Syed

unread,
Aug 1, 2025, 6:31:58 AMAug 1
to iDempiere
What could be the reason that the getter and setter are not able to load the column definitions sometimes?
usually it works and sometimes I get the following error randomly while using trekglobal rest api.
Looks like trekglobal rest api disturbs the PO Cache because of this cache issue, we got the following error. After resetting cache, it works fine.

Can you suggest the any concrete solution?


column not found.png

Syed

unread,
Aug 1, 2025, 6:34:44 AMAug 1
to iDempiere
column not found 2.png

Heng Sin Low

unread,
Aug 1, 2025, 7:48:32 AMAug 1
to idem...@googlegroups.com
Hi, you are not getting suggestions because there's no one else facing the same issue.

Syed

unread,
Aug 2, 2025, 3:02:58 AMAug 2
to iDempiere
Hi Hengsin,

What could be your approach if you face this kind of unique issue?
Let me give it a try.

Carlos Antonio Ruiz Gomez

unread,
Aug 2, 2025, 3:21:06 AMAug 2
to idem...@googlegroups.com
You can try this:

- Create the table in test.idempiere.org and see if it fails there

- that way other people can take a look to your table definition and most probably will be something misconfigured

and sometimes is worthy to add validations in core to protect against that misconfiguration



On 8/2/25 09:02, Syed wrote:
Hi Hengsin,

What could be your approach if you face this kind of unique issue?
Let me give it a try.


On Friday, August 1, 2025 at 5:18:32 PM UTC+5:30 hengsin wrote:
Hi, you are not getting suggestions because there's no one else facing the same issue.

On Fri, Aug 1, 2025 at 6:32 PM Syed <sy...@syvasoft.com> wrote:
What could be the reason that the getter and setter are not able to load the column definitions sometimes?
usually it works and sometimes I get the following error randomly while using trekglobal rest api.
Looks like trekglobal rest api disturbs the PO Cache because of this cache issue, we got the following error. After resetting cache, it works fine.

Can you suggest the any concrete solution?




Syed

unread,
Aug 3, 2025, 9:39:24 AMAug 3
to iDempiere
Hi Carlos,

In the test server, it is working fine, but not in my production server with my custom tables and columns.

Mentioned all the above issues, such as PK - FK and Column Not Found, are the outcome of the same reason.

Newly added columns to the core table and certain columns from the custom tables are skipped randomly from POInfo Cache 

Not columns are listed.png

After cache reset in both client side and system side, I get all the columns of my table from POInfo Cache
all columns are listed.png

It is still unpredictable.

Your ideas are welcome to find out the root cause of this problem.

Heng Sin Low

unread,
Aug 3, 2025, 10:37:34 AMAug 3
to idem...@googlegroups.com
1. Do you deploy using the installer from the official iDempiere jenkins build or using the build from your fork repository?
2. If you are using build from your fork repository, did your team make any changes to core or idempiere-rest ?
3. Either way, you also need to keep your deployment up to date with the official idempiere repository.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Jesús Castillo

unread,
Aug 3, 2025, 2:22:47 PMAug 3
to idem...@googlegroups.com
Hi, Syed

I think this is an issue related to the language of sessión. Try to log language from context before the error.
 
Atte: Jesus Castillo.


Jesús Castillo

unread,
Aug 3, 2025, 2:31:39 PMAug 3
to idem...@googlegroups.com

 Sorry, in my last email I didn't specify that the error might be due to the session having a language without translations, which prevents the columns from loading.
Atte: Jesus Castillo.

Carlos Antonio Ruiz Gómez

unread,
Aug 3, 2025, 3:52:35 PMAug 3
to iDempiere
This sounds like a problem in release 10 that has been solved in subsequent releases. My recommendation would be to upgrade your installation.

AFAIR, you must do a cache reset when adding new tables or columns.  You can try also this. 

Regards, 

Carlos Ruiz

Syed

unread,
Aug 3, 2025, 9:42:10 PMAug 3
to iDempiere
I have figured it out by myself after debugging the POInfo SQL in my Dev Environment then came here,  It's good that  Atte: Jesus Castillo. also faced the same issue.

I have fixed the issue by adding the missing translations for en_IN
In WebUI, en_SG is the base language. en_SG has all the translations, but in rest API, I have mistakenly used en_IN, which has fewer translations for the Elements because of this scenario, few columns are excluded.

Thank you guys for the support
Reply all
Reply to author
Forward
0 new messages