This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Cannot insert object in PersonInBaseTree because the associated object in BaseTree does not exist.

Hi,

As I am inserting an entry into PersonInOrg during updating of Person table, I received the following error:

Error during execution of statement: insert into PersonInOrg (UID_org, UID_Person)....

Cannot insert object in PersonInBaseTree because the associated object in BaseTree does not exist. 

Upon checking PersonInBaseTree table, entries tagged to the Person(based on UID_Person) shows there are entries in it.

What is the relationship between PersonInBaseTree, PersonInOrg & Person and what are the implications of any discrepancies between these tables?

I understand that PersonInOrg represents the secondary business roles assignment for the Person (correct me if im wrong).

However, the error that I am facing is now pointing to PersonInBaseTree, which I'm not sure why. 

Thank you!

Parents
  • Hi,
    there are multiple problems.
    1) It looks like you are running plain sql statments to insert assignement into the database. "insert into PersonInOrg (UID_org, UID_Person)" is missing multiple Columns written by default when using the object layer.
    -> always use the object layer to create, update or delete entries.
    2) It looks like the value you try to write into the column UID_Org is not valid. PersonInOrg is a view on PersonInBaseTree. PersonInOrg.UID_Org/PersonInBaseTree.UID_Org are foreign key columns referencing Org.UID_Org/BaseTree.UID_Org. A value writen into UID_Org has to be present in the referenced column.
    hth

Reply
  • Hi,
    there are multiple problems.
    1) It looks like you are running plain sql statments to insert assignement into the database. "insert into PersonInOrg (UID_org, UID_Person)" is missing multiple Columns written by default when using the object layer.
    -> always use the object layer to create, update or delete entries.
    2) It looks like the value you try to write into the column UID_Org is not valid. PersonInOrg is a view on PersonInBaseTree. PersonInOrg.UID_Org/PersonInBaseTree.UID_Org are foreign key columns referencing Org.UID_Org/BaseTree.UID_Org. A value writen into UID_Org has to be present in the referenced column.
    hth

Children
No Data