AnsweredAssumed Answered

Update relationship issue in SugarBean.php

Question asked by Juan Juan on May 26, 2014
Latest reply on Jun 10, 2014 by Juan Juan
Hi There,

We have created a flex relate field that can relate to Accounts, Contact etc in the Meeting module. I just found out that I could only save the related field(parent_id) when the parent_id is empty. If I just created a new meeting record, the parent_id was saved. if I tried to update to a new parent_id, parent_id is set to empty in database. then I updated it again, the parent_id could be saved.

I think the problem is in the function update_parent_relationships of SugarBean.php, when the relationship was removed ($this->$oldParentLink->delete($this->fetched_row[$idField], line 1953);), $this-> parent_id was set to empty at remove function of One2MBeanRelTionship.php. so the new parent_id could not be added any more.

Just wondering if anyone has the same issue and how you fix it. Thanks in advance.

Outcomes