Menu
SuiteCRM dedicated support by SalesAgility
Welcome, Guest
Username: Password: Remember me

TOPIC: logic hooks - how do I create a new related record when saving?

logic hooks - how do I create a new related record when saving? 2 months 2 weeks ago #70273

  • GsyUser
  • GsyUser's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Hi all,

I'm fairly new to SuiteCRM and php (historically working with VB / VB.NET / C#.NET ..

When a user creates a new record in my custom module I want to be able to create a new related record, save it and link it via the relationship to the record being created.

I've tried using the bean factory, however, things seem to fall apart when I call the save() method. Currently, I'm trying to achieve this using the before_save logic hook. However, I can't seem to get things to work. The examples I've found either want to link existing records, don't work or link to documentation which has been relocated.

I'd be grateful if someone could push me in the right direction.

Many Thanks
GsyUser
The administrator has disabled public write access.

logic hooks - how do I create a new related record when saving? 2 months 1 week ago #70390

  • GsyUser
  • GsyUser's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Turns out the main problem I was having was trying to create the record in the before_save hook, while the record I was creating also had a before_save hook.
Moving it to the 'process_record' hook seems to be working fine now.
The administrator has disabled public write access.
Time to create page: 0.044 seconds
Powered by Kunena Forum