what is the right way to create a bean from another existing bean ? in other words, how to duplicate bean in sugar in PHP.
i want to keep relationship too.
Not all relationships can be easily copied. Do you intend to copy each of the related records? Some relationships are 1:1 or 1:M.
For example, if you have a contactBean. You can clone the contactBean and unset the ID and indicate that it is new. Save the bean and then loop through each relationship to determine what to do.
What is your use case?