This topic contains 3 replies, has 3 voices, and was last updated by golriz.nourani 6 years, 5 months ago.
-
Topic
-
Hi Team ,
I have used an Column (timediff) which produces html content in datagrid that is used to show an indicator (Green/Red) in table based on the computed values in the query.We need a functionality that include a filter to filter this indicator.So i have used an extra column (timediffindicator) for this to work which sets a flag based on condition as given below
1CASE WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) > 30 THEN '<div style="width:15px;height:15px;border-radius:7px;line-height:20px;text-align:center;background:#ff4300;align:center;margin:0 auto"></div>' WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) IS NULL THEN '<div> </div>'ELSE '<div style="width:15px;height:15px;border-radius:7px;line-height:20px;text-align:center;background:#bdff00;align:center;margin:0 auto"></div>' END as timediff1CASE WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) > 30 THEN 1 WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) IS NULL THEN 2 ELSE 3 END as timediffindicatorSo As per my understanding when i filter the timediffindicator for value as 1 , it should display respective columns in timediff with #ff4300 indicators only displayed in table . But this filter is not working & an error is shown in Browser as shown :
Please find the filter not working for the indicators shown below (Ecart Horaire? => timediff Column):
Screenshot of Indicator & Filter
Please find the attached Datagrid Code given below:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273attendance-report:source:type: ormacl_resource: salesmentargets.target_indexquery:select:- cbu.name as BusinessUnitName- cbu.id as businessunitid- a.start- cntxt.name as Client- cntxt.clientnumber- TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) as timediffvalue- CASE WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) > 30 THEN '<div style="width:15px;height:15px;border-radius:7px;line-height:20px;text-align:center;background:#ff4300;align:center;margin:0 auto"></div>' WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) IS NULL THEN '<div> </div>'ELSE '<div style="width:15px;height:15px;border-radius:7px;line-height:20px;text-align:center;background:#bdff00;align:center;margin:0 auto"></div>' END as timediff- CASE WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) > 30 THEN 1 WHEN TIMESTAMPDIFF(MINUTE, a.start, att.createdAt) IS NULL THEN 2 ELSE 3 END as timediffindicatorfrom:- { table: %oro_calendar.calendar_event.entity.class%, alias: a }join:inner:- { join: a.account_89f0f6f, alias: cntxt }- { join: cntxt.owner, alias: cu }- { join: cu.owner, alias: cbu }left:- { join: PGAClientVisitBundle:Attendance, alias: att, conditionType: WITH, condition: 'att.calendarEventId = a' }- { join: PGAClientVisitBundle:VisitReport, alias: vr, conditionType: WITH, condition: 'vr.calendarevent = a' }bind_parameters:- uricolumns:BusinessUnitName:label: pga.clientvisit.visitreport.businessunitnameClient:label: pga.clientvisit.visitreport.nameclientnumber:label: pga.clientvisit.visitreport.clientnumberstart:label: pga.clientvisit.visitreport.timeofmeetingfrontend_type: datetimetimediff:label: pga.clientvisit.visitreport.timedifferencefrontend_type: htmlproperties:id: ~filters:columns:BusinessUnitName:label: oro.business_unit.labeltype: stringdata_name: BusinessUnitNameClient:type: stringdata_name: cntxt.namelabel: pga.clientvisit.visitreport.nameclientnumber:type: numberdata_name: cntxt.clientnumberlabel: pga.clientvisit.visitreport.clientnumberstart:type: datedata_name: a.startlabel: pga.clientvisit.visitreport.timeofmeetingtimediffindicator:label: pga.clientvisit.visitreport.timedifferencetype: choicedata_name: timediffindicatoroptions:field_options:choices:1: 'Yes'2: 'blank'3: 'No'options:export: truePlease need some suggestion on how to make filter work for this situation explained above.
Thanks & Regards,
Shreyas S
The forum ‘OroCRM’ is closed to new topics and replies.