Suitecrm 8.4 date not written back to database

Deb10 buster,
PHP = 8.2
MariaDB 10.6
Version 8.4.0

So i have created a custom module in the module builder.

This module is “Telephone Calls” as the standard “calls” module is far more advanced for what i need and using the standard calls function causes me a number of issues across other modules - so i bit the bullet and created a custom module.


All i need to capture in this custom module are the following fields.

“Date Created” - made by default
“Description” - made by default
“suite7id” - made by me to facilitate data migration from 7 > 8.4
“true_yes_c” - made by me to flag if call is done or not to facilitate workflow processes
“next_call_datettime_c” - made by me to indicate the next call date (workflow created based on this field to create an ‘activity’ to call the person on Date X Time X

“next_call_datetime_c” is giving me no end of trouble - when i am inputting data into this field i can’t see any values being written back to the database.

When i’m looking at the UPDATE & INSERT queries in the logs after activating debug mode - a NULL value is being passed - rather than the value I’ve selected on the screen before and hitting “Save”

Actual behavior - shows creation of the Telephone Call record, inserting of data, saving record & suite logs showing that the UPDATE or INSERT query is passing NULL

Expected behavior = insert values, press save, values passed to DB & present on record.

What i am trying to do is get the “next_call_datetime_c” field create a ‘Task’ in the parent record of the next call date as a start date via workflow functions - using the standard date field doesn’t work as there isn’t a time element in this data selection so it won’t create a start or due date as there is no time element :confused: I need a datettime value to pass through into the same field (Start/Due Dates in Tasks)

What can i do?

The default modules are tied in to other parts of the CRM in a myriad useful ways. I would never advise you to start your own calls module, even if you decided you could clear out most of the standard fields from your Call module views. It’s better to try that - use what is there that you find helpful; remove the rest from the views; add any necessary custom fields from Studio, not Module Builder.

But in using the standard call module for example - relationships aren’t automatically made between contacts and calls - I have to manually link the call that’s recorded into the system with the parent record.

Doesn’t appear to be a default calls sub panel either for contacts? Looking in pub/leg/mod/Contacts/metadata/subpaneldefs.php

Thus would then have me create relationships?

So i create the relationships - I get validation errors, red bars flashing at the top and a whole load of log space to read because it just isn’t functioning as expected?

I see in SQL that its trying to look for a meetings.date_due in the calls log - the query itself isn’t referencing a meetings table in the join

When i save the record in standard calls it throws me back to the contact record and the subpanel i’ve just created via a relationship in studio isn’t there - i’m having to do a whole load of work extra with the ‘default’ stuff than just creating a new module with the 2 fields i need and going from there?

Also - there isn’t a ‘Next Call Date’ within the default calls module - I’ve just had to create a new ‘Datetime’ field in studio to support what i’m trying to do

Same result - the query to INSERT/UPDATE the ‘Call’ database is passing through “NULL” datetime values.

I just tried as advised :confused:

I reset the module back to default before attempting.

There are “special” relationships between Calls and other Person modules such as Contacts.

When creating a Call, link it to a Contact - it’s there by default.

Then have a look at the History and Activities subpanels, these are “aggregating” panels.

Oh, and about the broken query (with the datetimes), that looks like a bug.

I am guessing it’s something to do with the date formats, these can be tricky and it’s possible that v8 is not very tested yet with alternate formats (different from the ones the dev team uses).

In this I’ve found my solution.

Commenting out the aggregating data in the respective activity/history sub panels removes the red bar at the top.

I just made a copy of the default module’s respective ForActivities and ForHistory.php files into the custom folder and refreshed

You sir - are a genius (see Calls module working as intended now!)

1 Like

I’ll raise that on GH now as issue.

1 Like