Associated the records to existing module

We have modules opportunities and custom module. We have create a one-to-many relationship between opportunities & custom modules.

We are inserting new records into the custom module every day programmatically.

Now, how to link these records from custom module to related opportunity module records automatically?

Do we need to set up scheduler or is there any other simpler way? :thinking: :thinking: :thinking:

I usually do this via the API via n8n.

Build one workflow to relate one record to the parent one / related one.

And then build a 2nd workflow to get / filter all records and loop through those and call the first workflow for each record.

Do you have something to work the API in place?

If you don’t need much additional logic, you probably can do this through a scheduler as well:

1 Like

How exactly does this happen?

If you’re already writing PHP code and using Beans, you just need to add the relationship with a few method calls.

Also, apart from PHP code, have you tried a simple SuiteCRM Workflow? It will get triggered or not, depending on how you save the data…

1 Like

So, we run the scheduler job in the CRM to update the records directly into the database.

I haven’t tried the workflow since we need some trigger for the workflow to run and human interaction.

So, I have build an another scheduler which will update the relationship table between opportunities & custom modules.

It seems to work correctly. Since, I could see the related records into the subpanel.

1 Like