Having a question about the dataexport of the data grid and related fields.
Following objects:
attendee.cfc:
component {
property name="label" formula="trim(concat_ws('', ${prefix}firstname , ' ', ${prefix}lastname , ' - ', ${prefix}eventid.alias ))" type="string" control="none";
property name="eventId" relationship="many-to-one" relatedTo="event";
property name="lastName" type="string" dbtype="varchar" maxlength="100";
property name="firstName" type="string" dbtype="varchar" maxlength="50";
...
}
and
event.cfc:
component {
property name="label" formula="trim(concat_ws('', DATE_FORMAT(${prefix}startdate,'%d.%m.%y') , ' - ', ${prefix}alias ))" type="string";
property name="alias" type="string" dbtype="varchar";
property name="startDate" type="date" dbtype="datetime" renderer="date";
...
}
When exporting contacts
from the datagri I get the following error:
[ERROR] [2024-03-19 17:16:38] An [database] error occurred running task. Error message: [Unknown column 'eventId$startdate' in 'field list']
The error is quite obvious, the label of event
can’t be calculated.
My questions are:
- Is this a bug? I know DB relations are complicated and what Preside does under the hood is already some kind of black magic.
- What is the best way to deal with this effect? Is there some best practice advice?
I would get around this with a new formula field in attendee
and calculate the field here and leave out the field eventId
from the export.
Thanks
Michi