Menu
SuiteCRM Pull Request Party hosted by SalesAgility
Welcome, Guest
Username: Password: Remember me

TOPIC: Create Relationship between 2 custom modules using field data

Create Relationship between 2 custom modules using field data 5 months 1 week ago #76203

  • AeroDonkey
  • AeroDonkey's Avatar
  • Offline
  • Premium Member
  • Nothing can't be done....!
  • Posts: 108
  • Thank you received: 3
  • Karma: 0
I have 2 modules that both have a unique id field that is NOT the SuiteCRM Record ID. These values are identical in both modules. Can these fields be used to create a relationship between the 2 modules using our unique id? I've tried to code this into my upload script using retrieve_by_string_fields() then load_relationship but get a database failure.

My upload script uses CSV and the ids exist within, however, if there is a better way to script this, or use a workflow to run on records within the database already, eliminating the addition of time it takes to complete uploads, that is preferable. Already takes forever for just a few records (15000 records over 24 hours, doesn't seem right, but its working so it is what it is :S )

I brought something similar up a while back but don't think I or Mr Crown Royal explained it very well

To be clear:

Module 1 is a huge pool of individuals - this modules contains extra information and should be linked to from Module 2
Module 2 is actual members - Contains company specific data only (Related field links to Module 1)

No relationships between the two are yet established
Last Edit: 5 months 1 week ago by AeroDonkey.
The administrator has disabled public write access.

Create Relationship between 2 custom modules using field data 5 months 1 week ago #76303

  • pgr
  • pgr's Avatar
  • Offline
  • Administrator
  • Posts: 10190
  • Thank you received: 1531
  • Karma: 351
This
I've tried to code this into my upload script using retrieve_by_string_fields() then load_relationship but get a database failure.

is likely happening because of this:
No relationships between the two are yet established

If you create a proper SuiteCRM relationship, you can manipulate it through beans. You could get all the records related, based on your own field. SuiteCRM would then implement its normal mechanism, and add a middle table with both SuiteCRM ids in there.

My SuiteCRM In-depth blog.
Thank you for always stating your SuiteCRM version, checking your logs, reading the Docs, and searching before you ask!
The administrator has disabled public write access.
Time to create page: 0.045 seconds
Powered by Kunena Forum